我如何知道Java对象是否在堆转储的使用期限或eden空间中 [英] How can I know whether a Java object is in tenure or eden space from heap dump

查看:173
本文介绍了我如何知道Java对象是否在堆转储的使用期限或eden空间中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Hotspot JVM堆转储,我试图找出一个对象是否在tenure空间,eden空间或幸存空间中,但我不能。



<如果有人能帮助我,请欣赏。

我不认为你可以。从这个论坛帖子,


对不起,坏消息,堆转储既不包含有关对象所在的
空间的信息


通过此页面查看java堆转储的内容似乎确认堆转储不包含生成信息,

  HEAP DUMP BEGIN(39793个对象,2628264字节)Wed Oct 4 13:54:03 2006 
ROOT 50000114(kind =< thread> ;, id = 200002,trace = 300000)
ROOT 50000006(kind =< JNI global ref> ;, id = 8,trace = 300000)
ROOT 50008c6f(kind =< Java stack> ;,线程= 200000,frame = 5)

CLS 50000006(name = java.lang.annotation.Annotation,trace = 300000 )
loader 90000001
OBJ 50000114(sz = 96,trace = 300001,class=java.lang.Thread@50000106)
名称50000116
group 50008c6c
contextClassLoader 50008c53
inheritedAccessControlContext 50008c79
blockerLock 50000115
OBJ 50008c6c(sz = 48,trace = 300000,class=java.lang.ThreadGroup@50000068)
name 50008c7d
线程50008c7c
群50008c7b
ARR 50008c6f(sz = 16,trace = 300000,nelems = 1,
elem type = java.lang.String [] @ 5000008e)
$ [0] 500007a5
CLS 5000008e(name = java.lang.String [],trace = 300000)
super 50000012
loader 90000001


I have a Hotspot JVM heap dump and I tried to find out whether an object is live in tenure space, eden space, or survivor space, but I could not.

Appreciate if someone can help me.

解决方案

I don't think you can. From this forum post,

sorry, bad news, the heap dump neither contains the info about the space the object is in

Looking at the contents of the java heap dumps from this page seems to confirm that the heap dump does not contain generation info,

HEAP DUMP BEGIN (39793 objects, 2628264 bytes) Wed Oct 4 13:54:03 2006
ROOT 50000114 (kind=<thread>, id=200002, trace=300000)
ROOT 50000006 (kind=<JNI global ref>, id=8, trace=300000)
ROOT 50008c6f (kind=<Java stack>, thread=200000, frame=5)
:
CLS 50000006 (name=java.lang.annotation.Annotation, trace=300000)
    loader        90000001
OBJ 50000114 (sz=96, trace=300001, class=java.lang.Thread@50000106)
    name        50000116
    group        50008c6c
    contextClassLoader    50008c53
    inheritedAccessControlContext    50008c79
    blockerLock    50000115
OBJ 50008c6c (sz=48, trace=300000, class=java.lang.ThreadGroup@50000068)
    name        50008c7d
    threads    50008c7c
    groups        50008c7b
ARR 50008c6f (sz=16, trace=300000, nelems=1, 
     elem type=java.lang.String[]@5000008e)
    [0]        500007a5
CLS 5000008e (name=java.lang.String[], trace=300000)
    super        50000012
    loader        90000001

这篇关于我如何知道Java对象是否在堆转储的使用期限或eden空间中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆