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

Answers were Sorted based on User's Feedback



How GC (Garbage Collector) knows the objects reference is unused.Whether GC removes the unused obje..

Answer / 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

How GC (Garbage Collector) knows the objects reference is unused.Whether GC removes the unused obje..

Answer / balamurugan

it checks whenever we will not used the objects in our
program then jvm checked with forward referenceduse help of
heap memory. then gb removes the un used objects

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

Which is the best way of exception handling?

2 Answers   Oracle,


Where local and global variables are stored?

0 Answers  


Why is it called a string?

0 Answers  


What are the disadvantages of using inner classes?

0 Answers  


When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?

0 Answers  






What is the use of default method in interface in java?

0 Answers  


Which one will take more memory: an int or integer?

0 Answers  


Explain Stream Tokenizer?

4 Answers  


Why do we need data serialization?

0 Answers  


What are the 6 boolean operators?

0 Answers  


Can we sort hashmap in java?

0 Answers  


Why call by value prevents parameter value change?

0 Answers  


Categories