6 Replies Latest reply: Aug 24, 2007 12:26 AM by 807605 RSS

    References to Objects on the Heap + Garbage Collection

    807605
      in my eternal battle to the death with the book im trying to finish i
      have another question: how does the JVM reference 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?