How to print the location of Heap using java for a process?
问题 I want to test if ASLR which randomizes the location of a heap for a process actually works. 回答1: You can't do this in pure Java. Machine address (pointers) are not exposed to Java applications. Even if they did, there's no Java API that tells you were the heap is. I suppose that you could use the values returned by System.identityHashcode() as ersatz machine addresses. If you wrote a simple Java test application that examined identity hashcode of a sample object, then ran it multiple times