Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Off Topic: Java developers please read

Author: Peter Schäfer

Date: 05:35:09 11/10/05

Go up one level in this thread


On November 09, 2005 at 18:06:42, James Swafford wrote:
>I wonder if any of you Java developers might have some insight?
>BTW, if it makes any difference at all: my application uses
>JInternalFrames, all contained within a single JFrame.  When an
>internal frame is closed, I simply do a dispose().  As far as I
>know, that should make all the objects within that frame eligible
>for garbage collection since they can't be referenced.

Do you store large amounts of objects in Hashtables, or Vectors ?
Don't forget to remove them when they are not needed anymore.
Or use WeakReferences which can be reclaimed by the GC.

Same with listeners, as already mentionend.
When you don't need the listener anymore, remove it.

Generally, it's a good idea to set unneeded references to null.


Swing is a memory hog, of course. But it doesn't produce memory leaks just by
itself.






This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.