How to get Object ID as used in Heap Dump
问题 I would like to be able to get the same ID that is being used in Java heap dumps (created via jmap or JMX, etc). This is to be able to identify the live object at the still running application versus an older memory snapshot (the heap dump) of the same app. I have already tested a little and it is obvioulsy not the hashCode, neither the JDI unique ID (which you can see in your debuggers). From checking the code in the sun.jvm.hotspot.utilities I assume it is the objects address in memory. But