bug-kawa
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-kawa] [bug #24041] memory leak when using disposable class loaders


From: Jean-Philippe Gariepy
Subject: [Bug-kawa] [bug #24041] memory leak when using disposable class loaders
Date: Mon, 11 Aug 2008 19:41:00 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1

URL:
  <http://savannah.gnu.org/bugs/?24041>

                 Summary: memory leak when using disposable class loaders
                 Project: Kawa
            Submitted by: gawi
            Submitted on: Monday 08/11/2008 at 19:40
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

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();
 ...
 





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?24041>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]