Java Reference
In-Depth Information
Figure 7-8. Indefinite references retain memory through GC cycles
On the righthand side of the diagram, memory is still consumed. The exact point at which the
referent gets freed varies by the type of the indefinite reference, but for now let's take the
case of a soft reference. The referent will stick around until the JVM decides that the object
has not been used recently enough. When that happens, the first GC cycle frees the refer-
ent—but not the indefinite reference object itself. The application ends up with the memory
state shown in Figure 7-9 .
Search WWH ::

Custom Search