How to dump Permgen?

2020-02-03 11:02发布

I wanted to take the dump of the Permgen of a application server.

I do not want to use -XX:+TraceClassLoading -XX:+TraceClassUnloading as i do not want to restart the server, Neither i want to use jconsole.

I there any tool like jmap(used to heap dump didnt find any option for permgen) to get the permgen so that i can supply only the pid.

3条回答
劳资没心,怎么记你
2楼-- · 2020-02-03 11:14

It is not possible to 'dump permgen' as it's done for the heap.

In addition to jmap -permstat as others have presented, you can analyze standard heap dump to shed some light on your permanent generation as described in this blog entry: 'The Unknown Generation: Perm'.

Because a heap dump does not really contain a lot of information about perm space, perm problems are difficult to tackle. Recently, I found this great article by Sporar, Sundararajan and Kieviet. The authors shed some light on the permanent generation. Of course, I had to check right away if and how I can use the Eclipse Memory Analyzer to analyze this “unknown” generation. This is what this blog is about.

查看更多
兄弟一词,经得起流年.
3楼-- · 2020-02-03 11:19
jmap -permstat <pid>
查看更多
乱世女痞
4楼-- · 2020-02-03 11:20
jmap -permstat <pid>

is going to produce an output like that :

30337 intern Strings occupying 2746200 bytes.
class_loader    classes bytes   parent_loader   alive?  type

<bootstrap> 2031    7253392   null      live    <internal>
0x517474f0  1   1760      null      dead    sun/reflect/DelegatingClassLoader@0x43f95d38
0x4f83f670  1   1744    0x4ebfb8e8  dead    sun/reflect/DelegatingClassLoader@0x43f95d38
[...]

total = 287 10020   35889952        N/A     alive=3, dead=284       N/A  

This is not a full dump, but doing that is going to allow you to do some investigation.

I am still looking on how to find more information.

查看更多
登录 后发表回答