I am a beginner in C and C++ and I don't know very well how to use the JVMTI. I want to get the physical memory location (in hexadecimal) of a java object. Is it possible? I don't want to get answers like "get it from this profiler etc" ... So far I am using this command in linux terminal :
java -showversion -agentpath:../CPrg/DLL/bin/Debug/libDLL.so SimpleMemAlloc
The libDLL.so is the library I am creating using c where I run it with my java application. It actually works, it runs with my code but I don't know how to get the data I want.
For example I am using this simple code:
public class SimpleMemAlloc{
Object [] oarray = new Object[10000];
public static void main(String args []){
Object [] o= new Object[100];
for (int i= 0; i<100; i++){
o[i] = new Integer [10000];
}
}
}
I want to get the memory location (0x...) of every new integer array that I create... I will be very happy if I get a nice sample code using the jvmti