Tracking object relocations in Java 8

David Griffiths dgriffiths at undo.io
Mon Nov 16 18:38:30 UTC 2020


Hi, I have a need to track object relocations in Java 8 with whatever the
default GC is. I would like to do this by setting a gdb conditional
breakpoint somewhere in the JVM such that it will stop when the copy to
address is a certain value (*). Can anyone point me in the right direction
for such a breakpoint please? Not looking for a clean solution, just
anything that will work.

(*) reason for wanting to do something as nasty as this: we have a product
that does a recording of a Java process at the machine code level and then
plays it back such that it pretends to be a JDWP agent. I've got a
particular recording where I want to use an "instance filter" in IntelliJ's
breakpoints to only stop for a specific instance. This actually works fine
but when going backwards in time it can happen that an object gets
relocated by GC and this screws up the filter. I could fix that if I set a
breakpoint at whatever point the object is relocated and then just start
tracking the previous location (and maybe mapping if necessary to fool
IntelliJ). Can't modify the GC code though.

Thanks!

David

-- 
David Griffiths, Senior Software Engineer

Undo <https://undo.io> | Accelerate software defect resolution by
eliminating the guesswork in failure diagnosis



More information about the hotspot-gc-dev mailing list