Ahmet Karakaya
Ahmet Karakaya

Reputation: 10139

The location of an individual object in JVM Heap Space

I am able to monitor the java application with various tools at JVM level. I can dump heap objects and find out the number of the objects and their total size.

At this point, I would like to know the heap location of each object, I mean, as you may know that there are three heap sections (eden, old, perm spaces), at the time of dump which object located at which heap space.

Upvotes: 2

Views: 179

Answers (1)

Peter Lawrey
Peter Lawrey

Reputation: 533530

The location of an individual object is not something you can trace. Just dumping the heaps can result in the objects moving. Whatever you are trying to do I suggest you do another way.

BTW: If you do a dump of "live" objects this triggers a full GC which can move all objects into the old gen, so in that situation you know where all the objects are. ;)

Upvotes: 2

Related Questions