The garbage collector scans the Java frame's local variables and operand stack
conservatively, which is unnecessary. We know that only handles occur in those
areas, never direct object pointers, so something that appears to be a direct
object pointer must really be a numeric quantity. Similarly, when scanning
the constant pool we scan conservatively, when we should be able to scan
exactly -- the only thing we need to mark there are String objects, and there
we always have handles, never direct object pointers.
The result can be unpredictable and unnecessary garbage being kept or
fragmentation. I've written the code to make these scans nonconservative,
and just need to stare at it some more.
conservatively, which is unnecessary. We know that only handles occur in those
areas, never direct object pointers, so something that appears to be a direct
object pointer must really be a numeric quantity. Similarly, when scanning
the constant pool we scan conservatively, when we should be able to scan
exactly -- the only thing we need to mark there are String objects, and there
we always have handles, never direct object pointers.
The result can be unpredictable and unnecessary garbage being kept or
fragmentation. I've written the code to make these scans nonconservative,
and just need to stare at it some more.