This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes About Garbage Collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "About Garbage Collection" Watch "About Garbage Collection" New topic
Author

About Garbage Collection

Jart Bo
Ranch Hand

Joined: Oct 22, 2007
Posts: 144
Hi,

An object has a valid reference, but no live thread has access to it. Will it be eligible for garbage collection?


SCJP, SCWCD
Ian Edwards
Ranch Hand

Joined: Aug 14, 2006
Posts: 107
I would say yes. As I understand it an object is eligible for garbage collection if no live threads have access to it.

The object that it has a reference to still exists unless it to is not being accessed by any live threads.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: About Garbage Collection
 
Similar Threads
Tech Word Game
Object Reference
TO the authors : "request" object
WeakHashMap