Fwd: Tracking object relocations in Java 8

David Griffiths dgriffiths at undo.io
Thu Nov 19 09:47:20 UTC 2020


BTW doesn't have to be a call to a "copy(from, to)" style function - if
there is some convenient place where a list of pointers is traversed to do
the update to the new location I'm quite happy to duplicate that code to do
the same traversal. I'm not yet familiar with the code so just a nudge in
the general direction would be great.

Another alternative - don't suppose there is any option to force hashcodes
to always be stored in the mark word (i.e. even if the hash code is not
requested)? Couldn't see any sign of one in the code but just thought I'd
ask. I guess -XX:hashCode=4 is just going to use the current address and
only if hash code requested so of no use to me.

Cheers,

David

---------- Forwarded message ---------
From: David Griffiths <dgriffiths at undo.io>
Date: Mon, 16 Nov 2020 at 18:38
Subject: Tracking object relocations in Java 8
To: <hotspot-gc-dev at openjdk.java.net>


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


-- 
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