🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #8378

Garbage Collection

#8378
From: Ali Demir
Date: Sat, 16 Sep 2000 00:00
29 lines
1804 bytes
Can't GC!!! Help!!!!

I have couple hundred panels and underlying models in a GUI application.

When I no longer need a model (an internal structure of objects), I try to
set all the reference paths to it to null.

To do this, I set my own references to the structure to null, and I also set
my own references to the panels that hold references to my objects. So I
expect that the panels and the model objects will get gc'ed.
The problem is that Swing is holding some references through some of it's
static variables.

As a result, none of my objects get garbage collected because internally
everything references everything. Only if I can cut off all the external
references, all of the structure will become ready for GC; in some cases, I
was able to do that. However, I don't know how to make swing not hold static
references to my objects. Those are created after some extensive user
interaction.

Does anyone have similar problem? Is there any trick here I can use?

Only solution I can think of is to go through all my panels and set their
GUI's to some other state, but even that won't guarantee freeing my objects
because I cannot imitate some complicated user interaction that might have
taken place that caused created those Swing references.

Thanks
Ali.
Technical Details
Message-ID: <39c3379b$1_1@dnews>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,5de4a95f12c3475f,start
X-Google-Attributes: gid111d45,public
From: "Ali Demir" <demir.4@osu.edu>
Subject: Garbage Collection
Date: 2000/09/16
Message-ID: <39c3379b$1_1@dnews>
X-Deja-AN: 670461572
X-Trace: 16 Sep 2000 02:04:27 -0800, 192.147.88.2
X-MSMail-Priority: Normal
X-Priority: 3
Reply-To: "Ali Demir" <demir.4@osu.edu>
Newsgroups: borland.public.jbuilder.java.swing
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400