Java Jmap 内存查看分析

Linux 环境下:

     

[root@myweb ~]# j
jade         javah        jcontrol     jpeg2ktopam  jsadebugd    jv-convert
jadetex      javap        jdb          jpegicc      jsattach     jvisualvm
jar          javaws       jhat         jpegtopnm    jscal        jvmjar
jarsigner    jbibtex      jinfo        jpegtran     jstack       jv-scan
java         jbigtopnm    jmap         jps          jstat        jw
javac        jcf-dump     jobs         jrunscript   jstatd       jwhois
javadoc      jconsole     join         jsaccess     jstest       

 产看java 进程获取pid root 后面的数字

 

[root@myweb ~]# ps -ef|grep java
root       994     1  3 Mar24 ?        00:39:12 /usr/local/jdk1.6/bin/java -server -Xms1024m -Xmx1024m -Xss512k -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+UseParallelGC -XX:+DisableExplicitGC -XX:ParallelGCThreads=8 -Xloggc:../logs/gc20110324170001.log -Dcom.sun.management.jmxremote -Djava.endorsed.dirs=/usr/local/tomcat5/common/endorsed -classpath /usr/local/jdk1.6/lib/tools.jar:/usr/local/tomcat5/bin/bootstrap.jar:/usr/local/tomcat5/bin/commons-logging-api.jar -Dcatalina.base=/usr/local/tomcat5 -Dcatalina.home=/usr/local/tomcat5 -Djava.io.tmpdir=/usr/local/tomcat5/temp org.apache.catalina.startup.Bootstrap start
root     16659 14523  0 10:28 pts/4    00:00:00 grep java

 

 生成文件

[root@myweb ~]# jmap -dump:file=dump.txt 994
Dumping heap to /root/dump.txt ...
Heap dump file created

 产看生成文件

[root@myweb ~]# ls -l
总计 998540
drwxr-xr-x 2 root root      4096 03-17 15:15 Desktop
-rw------- 1 root root 779368813 03-25 10:32 dump.txt
drwxr-xr-x 2 root root      4096 02-26 17:44 uploads

 

  

   压缩文件

[root@myweb ~]# tar -czvf dump.txt.tar.gz dump.txt 
dump.txt

 

你可能感兴趣的:(java,apache,linux,J#,sun)