Linked by Thom Holwerda on Thu 26th Jan 2006 18:58 UTC, submitted by anonymous
Java "While programs in the Java language are theoretically immune from memory leaks, there are situations in which objects are not garbage collected even though they are no longer part of the program's logical state. This article shows you how Soft references, like weak references, can help applications prevent object loitering by enlisting the aid of the garbage collector in making cache eviction decisions."
Permalink for comment 89978
To read all comments associated with this story, please click here.
RE: Object Loitering?
by nrlz on Fri 27th Jan 2006 10:37 UTC in reply to "Object Loitering?"
Member since:

Nice euphemism. If you don't call it a memory leak, it's not a memory leak. RIGHT...

How do you make a distinction between a crumpled up piece of paper thrown on the floor and a crumpled up piece of paper still held in someone's hand? i.e., which is garbage and which is not? That's the kind of gray area which garbage collectors have to consider.

The semantic stuff introduced by WeakReferences and SoftReferences is a big step forward and allow the programmer to give a hint to the garbage collector about stuff which is not strictly defined as "garbage".

Reply Parent Score: 1