Apache Sling ClassLoader Leak Detector

Clone this repo:
  1. 3bbd70d SLING-12094 - Use GitHub for the Maven scm.url value by Robert Munteanu · 9 months ago master
  2. b2a8880 SLING-11709 - Set up Jira autolinks to all Sling Github projects by Robert Munteanu · 1 year, 3 months ago
  3. a377366 SLING-11051 - Fixing JavaDoc badge by Dan Klco · 2 years, 5 months ago
  4. 0c0ba12 SLING-10676 - remove SECURITY.md which is not needed by Bertrand Delacretaz · 2 years, 11 months ago
  5. 2068c00 SLING-10676 - add or update SECURITY.md by Bertrand Delacretaz · 2 years, 11 months ago

Apache Sling

Build Status Coverage Sonarcloud Status JavaDoc Maven Central Contrib License

Apache Sling ClassLoader Leak Detector

This module is part of the Apache Sling project.

This bundle provides support for tracing classloader leaks which occur due to improper cleanup in bundles. Refer to SLING-3359 for background details.

The bundle registers a Felix Configuration Printer which dumps out a list of suspected classloaders which are not getting garbage collected. It can be accessed at http://localhost:8080/system/console/status-leakdetector

Possible classloader leak detected
Number of suspicious bundles - 1

* org.apache.sling.sample.leakdetector.bad-bundle (0.0.1.SNAPSHOT) - Classloader Count [2]
     - Bundle Id - 204
     - Leaked classloaders
         - Identity HashCode - 4a273519, Creation time 31.01.2014 15:22:58.407

JVM Arguments

By default on Oracle JDK the classloaders and related classes from Permgen are not garbage collected by default. This bundle relies on classloaders getting garbage collected for it work. So to enable that pass on following arguments

 -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled