美文网首页java web 学习Java学习笔记程序员
论持久战之Java性能监控工具(jmap)

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

作者: 怪咖_OOP | 来源:发表于2016-12-25 15:07 被阅读399次

    首先看一下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

    相关文章

      网友评论

      本文标题:论持久战之Java性能监控工具(jmap)

      本文链接:https://www.haomeiwen.com/subject/txtdvttx.html