When does an Object becomes eligible for Garbage collection in Java ?
When does an Object becomes eligible for Garbage collection in Java ?
Answer
A Java object is subject to garbage collection when it becomes unreachable to the program in which it is currently used.
Garbage Collection does occur in PermGen space and if PermGen space is full or cross a threshold, it can trigger a full garbage collection. If you look carefully at the output of the garbage collector, you will find that PermGen space is also garbage collected. This is the reason why correct sizing of PermGen space is important to avoid frequent full garbage collections.
Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website.
If you are using this website then its your own responsibility to understand the content of the website