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

首先看一下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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容