I
Indbond
hi all,
This is w.r.t. the Class WeakReference. The java docs says whenever an
object is weakly reachable i.e there is not strong or soft references
to it , the object will be garbage collected.
As i understand with this is that the object is no longer referred by
anyone in the active thread or in any other secondary thread so it
will be garbage collected But isn't this how the GC is suppose to
work? Whenever the reference count of the object is 0 it is eligible
to get garbage collected (after finalize is called ) so why is the
preference given to the object contained in the class WeakReference
for GC and not the other objects whose ref. count is 0
I hope i am clear with my question ?
regards
Indbond
This is w.r.t. the Class WeakReference. The java docs says whenever an
object is weakly reachable i.e there is not strong or soft references
to it , the object will be garbage collected.
As i understand with this is that the object is no longer referred by
anyone in the active thread or in any other secondary thread so it
will be garbage collected But isn't this how the GC is suppose to
work? Whenever the reference count of the object is 0 it is eligible
to get garbage collected (after finalize is called ) so why is the
preference given to the object contained in the class WeakReference
for GC and not the other objects whose ref. count is 0
I hope i am clear with my question ?
regards
Indbond