File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Performance and the fly likes Locating An Instance from Its Physical Address Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Locating An Instance from Its Physical Address" Watch "Locating An Instance from Its Physical Address" New topic

Locating An Instance from Its Physical Address

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
I have a native memory scanning tool in Windows that let me identify which viirtual address of a process contains the data I needed. I used it on java.exe and found the the address of my target data in the jvm process. However, is it possible to figure which instance is related to that particular address from, say, the heap dump? So far, I never found anything related to address in the heap dump of tools like VisualVM.
Peter Johnson

Joined: May 14, 2008
Posts: 5852

As far as I know, heap dumps do not contain memory addresses, they contain only object id info which is needed to reestablish the references.

Besides, objects move around in memory every time a GC happens so knowing an object's memory address is not that helpful.

JBoss In Action
Andrei Matyas

Joined: Apr 15, 2007
Posts: 25
Yes indeed the real memory address of un object is meaningless because the GC can move objects around in memory.
Anyway, for fun, take a look at the Unsafe class maybe this may do what you need.

I agree. Here's the link:
subject: Locating An Instance from Its Physical Address
It's not a secret anymore!