Bugs item #1524187, was opened at 2006-07-18 11:59
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=379133&aid=1524187&group_id=23629

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Tobias T (twobeers)
Assigned to: Nobody/Anonymous (nobody)
Summary: memory hole: parent Component + Jmol don't get finalized

Initial Comment:
Hey guys,

thank you so much for providing Jmol. However, there is
one bug that really bugging me: Jmol has a memory hole,
and this means that by usign Jmol, my client program
has one too :-(

Apparently Jmol somehow stores a reference to itself
and the Component passed to JmolViewer.allocateViewer()
in some place that itself remains referenced forever:
Repeated invocations of allocateViewer() will
continuously increase the memory consumption, until a
java.lang.OutOfMemoryError occurs.

If an empty JPanel is passed as the component, the
memory usage increases by about 32 KBytes per
invocation. The JPanel itself is never finalized even
when the client program stores no references to it; the
JPanel itself is lightweight at less than 1 KByte.

I've attached a JUnit testcase that illustrates the
bug. The memory usage shouldn't increase from the start
to the end of the testcase, but it does increase by
tens of Megabytes (on my computer, using JDK 1.5.0_06
under win32, 1000 iterations yield 32,326,200 bytes lost). 

I've overriden the JPanel's finalize() method to
illustrate that the component never gets garbage
collected. Because the JPanel itself doesn't consume
this much memory, and because the Jmol Viewer is the
only thing that stiill has a reference to the panel, it
follows that the Jmol Viewer never gets garbage
collected either.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=379133&aid=1524187&group_id=23629

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to