2

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.

4

1 回答 1

2

单个对象的位置不是您可以追踪的。只是转储堆可能会导致对象移动。无论你想做什么,我建议你做另一种方式。

顺便说一句:如果您转储“活动”对象,则会触发完整的 GC,该 GC 可以将所有对象移动到旧代中,因此在这种情况下您知道所有对象在哪里。;)

于 2012-08-07T11:05:47.373 回答