title: How to get Object ID as used in Heap Dump
body: <p>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. </p>
  
  <p>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). </p>
  
  <p>From checking the code in the sun.jvm.hotspot.utilities I assume it is the objects address in memory. But also my tests with sun.misc.Unsafe didn't lead to the same id value as used in the heap dumps. (see here for some Unsafe explanation: <a href="http://zeroturnaround.com/rebellabs/dangerous-code-how-to-be-unsafe-with-java-classes-objects-in-memory/" rel="nofollow">http://zeroturnaround.com/rebellabs/dangerous-code-how-to-be-unsafe-with-java-classes-objects-in-memory/</a>)</p>
  
  <p>Any ideas? Thanks :) !</p>