🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.java.programmer
Article #584

Re: How to force swing window to destroy

#584
From: Gregor Schmid
Date: Mon, 29 May 2000 00:00
33 lines
2036 bytes
Swing Components have quite a few invisible references to each other,
some of them in static caches, which makes it very difficult to really
isolate a window and all its nested components so the garbage
collector can do its job. Menus are especially troublesome.

What I do is walk the Component tree and break all parent/child
references, remove all menu items etc. This reclaims more than 90% of
the resources that are otherwise wasted.

You can find some example code in our free Java Library qflib which is
available at
http://www.qfs.de/en/projects/qflib/index.html

Take a look at de.qfs.lib.gui.SwingUtil.cleanup.

Regards,
	Greg

rocha <rocha@haisystems.com> writes:

> I have an application which instantiates many different windows.  as the
> application progresses, the performance degrades.  I have traces this
> problem to the fact that none of the windows are being destroyed until
> the application terminates and they are holding a lot of memory.  it
> seems to me that something is still holding a reference to the windows(
> possible the parent window), but i  don't know how to force there
> destruction.  does anyone know how to do this?  thanks in advance
> Ilougino Rocha.

-- 
Gregor Schmid                                      gs@qfs.de
Quality First Software                     http://www.qfs.de
Technical Details
Message-ID: <m3og5pae9m.fsf@gs.wor.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <392E412A.8259351@haisystems.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb99b,dc33438d3c04e295
X-Google-Attributes: gidfb99b,public
X-Google-Thread: 10a146,dc33438d3c04e295
X-Google-Attributes: gid10a146,public
From: Gregor Schmid <gs@qfs.de>
Subject: Re: How to force swing window to destroy
Date: 2000/05/29
Message-ID: <m3og5pae9m.fsf@gs.wor.net>
X-Deja-AN: 628546371
References: <392E412A.8259351@haisystems.com>
X-Complaints-To: usenet@euler.space.net
X-Trace: euler.space.net 959594534 10232 212.11.225.4 (29 May 2000 10:02:14 GMT)
Organization: Customer of SpaceNet GmbH
NNTP-Posting-Date: 29 May 2000 10:02:14 GMT
Newsgroups: comp.lang.java.programmer,cz.comp.lang.java