[ 
https://issues.apache.org/jira/browse/SLING-3359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13888500#comment-13888500
 ] 

Rohit Kumar commented on SLING-3359:
------------------------------------

Just a small observation. I guess following code might prevent garbage 
collection of last BundleReference object and in turn the classloader 
associated with it. Local variable "ref" will hold reference to last 
BundleReference object returned from queue until  queue does not generate a new 
entry. So for waiting duration, last BundleReference object cannot be gced. 
We should probably assign null to ref after each iteration of the loop. 

 while (!Thread.currentThread().isInterrupted()) {
            try {
                BundleReference ref = (BundleReference) queue.remove();
                if (ref != null) {
                    removeBundle(ref);
                }
            } catch (InterruptedException e) {
                break;
            }

> Classloader Leak Detector Console Tab
> -------------------------------------
>
>                 Key: SLING-3359
>                 URL: https://issues.apache.org/jira/browse/SLING-3359
>             Project: Sling
>          Issue Type: New Feature
>          Components: Console
>            Reporter: Ian Boston
>            Assignee: Chetan Mehrotra
>         Attachments: 
> org.apache.sling.extensions.classloader-leak-detector-0.0.1-SNAPSHOT-src.zip
>
>
> Chetan has created a classloader leak detector console at 
> https://github.com/chetanmeh/sling-leak-detector. It would be really good to 
> get this into the contrib are and released so that consumers of Sling can use 
> it to locate code in bundles that is leaking classloaders.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to