我有一些permgen溢出的问题.我可以使用哪些工具来查看现在加载到permgen中的类以及它们使用了多少内存?谢谢.
dog*_*ane 10
也许你有一个很大的代码库或者是很多字符串.
试试jmap:
jmap -permstat <pid>
Run Code Online (Sandbox Code Playgroud)
(注意:该permstat选项在Windows中不可用)
例:
$ jmap -permstat 22982
Attaching to process ID 22982, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 17.0-b16
100691 intern Strings occupying 5641096 bytes.
finding class loader instances ..Finding object size using Printezis bits and skipping over...
done.
computing per loader stat ..done.
please wait.. computing liveness..done.
class_loader classes bytes parent_loader alive? type
<bootstrap> 303 1355992 null live <internal>
0xdd159fe8 9 94104 0xdd153c30 live sun/misc/Launcher$AppClassLoader@0xae7fcfa0
0xdd153c30 0 0 null live sun/misc/Launcher$ExtClassLoader@0xae7b0178
total = 3 312 1450096 N/A alive=3, dead=0 N/A
Run Code Online (Sandbox Code Playgroud)
您还可以尝试将堆转储到文件中,然后将其加载到Eclipse Memory Analyzer中,这将为您提供有用的信息,例如Leak Suspects Report和Dominator Tree.
jmap -dump:format=b,file=heap.bin 22982
Run Code Online (Sandbox Code Playgroud)
如有必要,可以使用-XX:MaxPermSizeJVM选项增加PermGen空间.
Vin*_*nze -1
看起来您搜索的是一个探查器。(例如jProfiler或开源:http://java-source.net/open-source/profilers)
| 归档时间: |
|
| 查看次数: |
4753 次 |
| 最近记录: |