ITPub博客

首页 > IT职业 > IT生活 > JVM dump和分析

JVM dump和分析

IT生活 作者:drinkant 时间:2021-09-09 10:02:02 0 删除 编辑

1、dump

jmap -dump:live,format=b,file=~/Desktop/dump.hprof 1110

其他参数意义:

Usage:
    jmap [option] <pid>
        (to connect to running process)
    jmap [option] <executable <core>
        (to connect to a core file)
    jmap [option] [server_id@]<remote server IP or hostname>
        (to connect to remote debug server)

where <option> is one of:
    <none>               to print same info as Solaris pmap
    -heap                to print java heap summary
    -histo[:live]        to print histogram of java object heap; if the "live"
                         suboption is specified, only count live objects
    -clstats             to print class loader statistics
    -finalizerinfo       to print information on objects awaiting finalization
    -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>                         Example: jmap -dump:live,format=b,file=heap.bin <pid>
    -F                   force. Use with -dump:<dump-options> <pid> or -histo
                         to force a heap dump or histogram when <pid> does not
                         respond. The "live" suboption is not supported                         in this mode.
    -h | -help           to print this help message
    -J<flag>             to pass <flag> directly to the runtime system

2、分析内存

下载HeapAnalyzer,下载完更名为ha453.jar,执行:

java -jar ha453.jar

打开dump.hprof:

图片描述

image

图片描述

image

图片描述

image



作者:我是杨正
链接:https://www.jianshu.com/p/7fa32729dd1f


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/1297/viewspace-2815438/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-04-15

  • 博文量
    114
  • 访问量
    1257