How GC (Garbage Collector) knows the objects reference is
unused.Whether GC removes the unused object Parmanently or
it maintains something.

Answer Posted / devarathnam.c, kotagudibanda,k

Hi,
The Garbage Collector(GC)will be always under the control
of JVM, So JVM periodically runs the GC. It uses "sweep"
and "mark" algorithms to identify the unused objects in the
application. You don't bother about GC, JVM will take of it.

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you override a private method in java?

590


In a program, initializing an array of 100 KB is throwing an out of memory exception while there is 100 MB of memory available. Why?

654


Explain the difference between string, stringbuffer and stringbuilder in java?

652


What is the difference between final, finally and finalize()?

652


Which is dependent variable?

567






Is a boolean 1 bit?

707


Difference between keyword and identifier.

678


Write a code to show a static variable?

715


Class c implements interface I containing method m1 and m2 declarations. Class c has provided implementation for method m2. Can I create an object of class c?

1128


What are local variables?

687


What is a class component?

720


how to prepare for IT Officers Interview in Banks

1588


Is java an ide?

615


How to find the index of the largest number in an arraylist java?

616


What is the use of isempty in java?

641