Article View: borland.public.jbuilder.java.swing
Article #11558Memory usage keeps on growing with JInternalFrames? (no proper dispose?)
From: Eelco Hillenius
Date: Wed, 05 May 1999 00:00
Date: Wed, 05 May 1999 00:00
22 lines
1804 bytes
1804 bytes
I wrote a MDI application in Java. My main JFrame contains a menu and a JDesktopPane. When a user selects a menu item, a corresponding JInternalFrame is created and added to the JDesktopPane. After the user closes the frame, I make sure dispose() is called on the frame... But this does nothing! It keeps the reference and the memory, and when the user selects the same menu-item again, memory grows. I noticed that - even though I called dispose - the next time to JInternalFrame is created and shows, it has the same values (like size and selections) as last time. Howcome? Even when I wait for some time, the JInternalFrame is not carbage collected, but when I try to reference it without calling new() I get a null-pointer exception (and that is the only thing I can agree with!). Is there some way to force or speeden garbage collection? And... why, if I call dispose on a JInternalFrame, it is'nt disposed at all? If things like these happen a lot, I would rather program I C++ - sure you'll end up with memory-leaks, but at least you can conrol it (I hope I'm wrong though). Can someone help me out please? I've got a very dissapointed customer... Eelco Hillenius
Technical Details
Message-ID:
<925914584.945099@tbird.introweb.nl>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,84b0a0fc8fdeea1a,start X-Google-Attributes: gid111d45,public From: "Eelco Hillenius" <illy@cybercomm.nl> Subject: Memory usage keeps on growing with JInternalFrames? (no proper dispose?) Date: 1999/05/05 Message-ID: <925914584.945099@tbird.introweb.nl> X-Deja-AN: 474329585 Cache-Post-Path: tbird.introweb.nl!unknown@ip51-37.introweb.nl Organization: IntroWeb Newsserver X-Cache: nntpcache 2.3.2 (see http://www.nntpcache.org/) X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Newsgroups: borland.public.jbuilder.java.swing