java web 学习Java学习笔记程序员

论持久战之Java性能监控工具(jmap)

2016-12-25  本文已影响399人  怪咖_OOP

首先看一下Java官方提供的参数示例:

Paste_Image.png

下面介绍三个常用参数(heap、dump、histo)

-heap(to print java heap summary)

①堆配置信息

Paste_Image.png

②堆使用信息

Paste_Image.png

-dump:<dump-options>(to dump java heap in hprof binary format)

          dump-options:
                       live         dump only live objects; if not specified,
                                    all objects in the heap are dumped.
                       format=b     binary format
                       file=<file>  dump heap to <file>

中文意思:把进程内存使用情况dump到文件中(使用jhat工具分析查看)
jmap -dump:format=b,file=文件名 <pid>

-histo[:live](to print histogram of java object heap; if the "live"suboption is specified, only count live objects)

中文意思:查看堆内存中的对象数目、大小统计直方图,如果带上live则只统计活对象
jmap -histo:live <pid>

Paste_Image.png
上一篇下一篇

猜你喜欢

热点阅读