Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

What is the need to implement Serializable interface (with no methods) for objects which are to be serialized ? We can write our own functionality which writes objects to streams then why we need to implement and tell JVM that which objects can be serialized.

6 Answers   iFlex, Sapient,


How do you remove duplicates from an array in java?

0 Answers  


what is recursion in java

0 Answers   Cap Gemini,


What is a lock or purpose of locks in java?

0 Answers  


can java object be locked down for exclusive use by a given thread? Or what happens when a thread cannot acquire a lock on an object? : Java thread

0 Answers  






Can an object be garbage collected while it is still reachable?

3 Answers  


What is lexicographically smallest string?

0 Answers  


can rmi and corba based applications interact ?

0 Answers  


How do you write a good declaration?

0 Answers  


What is the meaning of 3 dots in java?

0 Answers  


What is internal variable?

0 Answers  


why java is better then .net?

5 Answers   HCL, iGate,






Categories