How is Garbage collection done in Java?

Answer Posted / sandeep

Garbage Collection is a complex feature in Java Technology.
By Programme we cannot cause gc but we can request JVM using
gc() method but it does not gurantee. Actually when an
object in our programme become unreachable it is ready to
garbage collection..the garbage collection runs periodically
and then claim the memory it does occupy ( the unreachable
object)..and is how garbage collected is done.

Is This Answer Correct ?    17 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How destructors are defined in java?

907


Can set contain duplicates?

780


How can you say java is object oriented?

842


Explain the polymorphism principle?

798


Is arraylist a class in java?

776


What do you mean by global variable?

728


What is the requirement of thread in java?

840


Can list have duplicates in java?

715


What are anonymous inner classes?

769


What is the difference between Grid and Gridbaglayout?

813


Can we modify the throws clause of the superclass method while overriding it in the subclass?

796


What is advantage of java?

777


How many bits is size_t?

755


What is collection sort in java?

773


What do you understand by java virtual machine?

938