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
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 |
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 |
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.
How do you remove duplicates from an array in java?
what is recursion in java
What is a lock or purpose of locks in java?
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
Can an object be garbage collected while it is still reachable?
What is lexicographically smallest string?
can rmi and corba based applications interact ?
How do you write a good declaration?
What is the meaning of 3 dots in java?
What is internal variable?
why java is better then .net?