Referencing Objects and the Garbage Collector
843829Aug 24 2007 — edited Aug 24 2007in my eternal battle to the death with the book im trying to finish i
have another VM question: how does the JVM reference and retrieve objects?
i know references are 4 bytes. i always thought they were
memory locations of the object. however, doesnt the garbage
collector move data in the heap sometimes to create more contiguous
regions of free memory? if so, wouldnt that invalidate the references?
is there an intermediate table that matches a reference to the
object location?
------------------------------
also,
http://java.sun.com/docs/books/jvms/second_edition/html/Overview.doc.html#15730
"Heap storage for objects is reclaimed by an automatic storage management system (known as a garbage collector); ... The Java virtual machine assumes no particular type of automatic storage management system."
Does that mean that the reference and retrieval system is undefined
also?
--------------------------------
im new to VM stuff so take pity if im totally off base ; )
NOTE:
i previously mistakenly posted this question in the wrong section:
http://forum.java.sun.com/thread.jspa?messageID=9841702