How the garbage collection works for java.

Showing Answers 1 - 2 of 2 Answers

Nevetha

  • Nov 11th, 2006
 

Java uses a reference counting Algo for Garbage Collection.When a ref enters JVM the ref count is incremented. When it leaves JVM the count is decremented.When an object is not refernced at all (i.e) the ref count becomes zero then the object is ready for Garbage collection

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions