Java / Garbage collection
When does an Object become eligible for Garbage collection in Java?
An object becomes eligible for garbage collection when there is no reference for that object or it inaccessible by any live thread.
Cyclic reference where two objects are pointing to each other and there is no live reference for any of them, than both are eligible for GC.
Garbage collection thread is a daemon thread which will run by JVM based upon GC algorithm and when runs it collects all objects which are eligible for GC.
More Related questions...