This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Locating An Instance from Its Physical Address" Watch "Locating An Instance from Its Physical Address" New topic
Author

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
author
Bartender

Joined: May 14, 2008
Posts: 5838
    
    7

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
Greenhorn

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: http://aspose.com/file-tools
 
subject: Locating An Instance from Its Physical Address