Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Referencing Objects and the Garbage Collector

843829Aug 24 2007 — edited Aug 24 2007
in 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 21 2007
Added on Aug 24 2007
7 comments
82 views