Sunday, July 11, 2010

Puzzle 60 (Go Soft) - Solution

Last week we looked at soft-reference and the answer that naturally comes is what the Java Doc has to say about soft references "As long as the referent of a soft reference is strongly reachable, that is, is actually in use, the soft reference will not be cleared".
Looking at the code - we have strongly reachable reference to the MemoryIntensiveObject(), O and one would expect the soft reference to exists. However as Jeremy Manson points out in his blog, this might not necessarily be the case.

As mentioned before this question was based on the Jeremy Manson blog post.

No comments:

Post a Comment

Solution for this question?