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:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Add a New Comment(Rich 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:

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:


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


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 Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

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

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-08-11 gawi Carbon-Copy- => Added gawi

    Back to the top

    Powered by Savane 3.4