This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan 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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 5772
    
    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.


 
Don't get me started about those stupid light bulbs.
 
subject: Locating An Instance from Its Physical Address
 
Similar Threads
HashMap value stores complete string
Taking thread dump of Weblogic 8.1 in Solaris box
issue with app running xslt style sheet on large xml files
JBoss 4.0.4 is slow down in every 20 days
Hacking into my own code / Dynamically updating .jars on an active process