SCJP
Visit my download page
I am the most eligible bachelor in whole world, but only known in limited territory!!!
Digital Intoxication Blog
Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!
....
Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!
Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
....
Originally posted by Ajith Kallambella:
String literals( string objects that are not new'd ) are a part of the constant string pool that is maintained on a per-class basis. Unlike the objects that are created on the heap which gets garbage collected using a "no-active-reference" logic, the objects in the constant pool are not GC'd until the class gets unloaded.
The JVM spec suggests, but not mandates, that the constant runtime pool for all classes be cleaned up when the class is unloaded by the JVM. However, since this is not a must-have feature, there are several implmentations of VM which ignores this requirement leaving behind many unclaimed objects.
FYI, there are some implementations of VM that are written for typically small devices such as wireless phones or PDAs, where memory is an expensive resource, that actually follow this requirement and sweep even the constant runtime pool before unloading the class.
You may want to checkout the VM spec about the details of the constant runtime pool incase you are curious.
Hope that helps
Ajith
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|