bugKawa - Bugs: bug #24041, memory leak when using disposable...

 
 

bug #24041: memory leak when using disposable class loaders

Submitted by:  Jean-Philippe Gariepy <gawi>
Submitted on:  Mon 11 Aug 2008 07:40:58 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 11 Aug 2008 07:40:58 PM UTC, original submission:

This problem arise when:
-kawa classes are loaded by a classloader different from the
system class loader (i.e. in a web app)
-and the classloader used to load kawa is disposed (like reloading an application in a web application container) in order to garbage collect the classes defined by it

This is a variation of something described here:
http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java

Shutdown hooks registered by WriterManager are stored in a container loaded by the system class loader. The hook keeps a reference to an instance of WriterManager. In turn, the WriterManager instance keeps a reference to its class object, the class object keeps a reference to the classloader itself, making it impossible for the garbage collector to reclaim the class loader and to free the permanent generation space.

Shutdown hooks should only be added for "main" modules (runAsMain) or when running kawa.repl.main().

Current code is:

Scheme.java:

public static final kawa.repl repl;
...
static
{
...
repl = new kawa.repl(instance);
...
}

repl.java:

...
static boolean shutdownRegistered
= gnu.text.WriterManager.instance.registerShutdownHook();
...

Jean-Philippe Gariepy <gawi>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gawi (Submitted the item)
  • -unavailable- added by gawi
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 11 Aug 2008 07:40:58 PM UTCgawiCarbon-Copy-=>Added gawi

    Back to the top


    Powered by Savane 3.1-cleanup