显示java进程内存使用的相关信息
[list]
[*]jmap pid #打印内存使用的摘要信息
[*]jmap –heap pid #java heap信息
[*]jmap -histo:live pid #统计对象count ,live表示在使用
[*]jmap -histo pid >mem.txt #打印比较简单的各个有多少个对象占了多少内存的信息,一般重定向的文件
[*]jmap -dump:format=b,file=mem.dat pid #将内存使用的详细情况输出到mem.dat 文件
[/list]
用jhat命令可以参看 jhat -port 7000 mem.dat
然后使用:http://127.0.0.1:7000/ 查看类相关信息
各个className
[table]
||BaseType Character ||Type ||Interpretation
|| B||byte||signed byte
|| C||char||Unicode character
|| D||double||double-precision floating-point value
|| F||float||single-precision floating-point value
|| I||int||integer
|| J||long||long integer
|| L<classname>;||reference||an instance of class <classname>
|| S||short||signed short
|| Z||boolean||true or false
|| [||reference||one array dimension[/table]
参考:http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html
[list]
[*]jmap pid #打印内存使用的摘要信息
[*]jmap –heap pid #java heap信息
[*]jmap -histo:live pid #统计对象count ,live表示在使用
[*]jmap -histo pid >mem.txt #打印比较简单的各个有多少个对象占了多少内存的信息,一般重定向的文件
[*]jmap -dump:format=b,file=mem.dat pid #将内存使用的详细情况输出到mem.dat 文件
[/list]
用jhat命令可以参看 jhat -port 7000 mem.dat
然后使用:http://127.0.0.1:7000/ 查看类相关信息
各个className
[table]
||BaseType Character ||Type ||Interpretation
|| B||byte||signed byte
|| C||char||Unicode character
|| D||double||double-precision floating-point value
|| F||float||single-precision floating-point value
|| I||int||integer
|| J||long||long integer
|| L<classname>;||reference||an instance of class <classname>
|| S||short||signed short
|| Z||boolean||true or false
|| [||reference||one array dimension[/table]
参考:http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html