wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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: 5812
    
    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.


 
Consider Paul's rocket mass heater.
 
subject: Locating An Instance from Its Physical Address
 
Similar Threads
JBoss 4.0.4 is slow down in every 20 days
issue with app running xslt style sheet on large xml files
HashMap value stores complete string
Hacking into my own code / Dynamically updating .jars on an active process
Taking thread dump of Weblogic 8.1 in Solaris box