标签:src spec font 最大堆 query 分析 out key 树状图
jhat
JVM Heap Analysis Tool命令是与jmap搭配使用,用来分析jmap生成的dump,jhat内置了一个微型的HTTP/HTML服务器,生成dump的分析结果后,可以在浏览器中查看。在此要注意,一般不会直接在服务器上进行分析,因为jhat是一个耗时并且耗费硬件资源的过程,一般把服务器生成的dump文件复制到本地或其他机器上进行分析。【内存分析】
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | [root@localhost bin] # jhat -help Usage: jhat [-stack <bool>] [-refs <bool>] [-port <port>] [-baseline < file >] [-debug <int>] [-version] [-h|-help] < file > -J<flag> Pass <flag> directly to the runtime system. For example, -J-mx512m to use a maximum heap size of 512MB -stack false : Turn off tracking object allocation call stack. -refs false : Turn off tracking of references to objects -port <port>: Set the port for the HTTP server. Defaults to 7000 -exclude < file >: Specify a file that lists data members that should be excluded from the reachableFrom query. -baseline < file >: Specify a baseline object dump. Objects in both heap dumps with the same ID and same class will be marked as not being "new" . -debug <int>: Set debug level. 0: No debug output 1: Debug hprof file parsing 2: Debug hprof file parsing, no server -version Report version number -h|-help Print this help and exit < file > The file to read For a dump file that contains multiple heap dumps, you may specify which dump in the file by appending "#<number>" to the file name, i.e. "foo.hprof#3" . All boolean options default to "true" |
参数
1 | jhat -J-Xmx512m dump.hprof |
1 | jhat -port 7000 mem.dat |
jmap -dump:format=b,file=mem.dat pid #将内存使用的详细情况输出到mem.dat 文件
通过jhat -port 7000 mem.dat可以将mem.dat的内容以web的方式暴露到网络,访问http://ip-server:7000查看。
标签:src spec font 最大堆 query 分析 out key 树状图
原文地址:http://www.cnblogs.com/myna/p/7590620.html