在SUSE中,當用pmap 查看 java 進程時,會看到很多信息
> pmap 32088
32088: java
START SIZE RSS PSS DIRTY SWAP PERM MAPPING
0000000040000000 36K 36K 1K 0K 0K r-xp /usr/java/jdk1.6.0_31/bin/java
0000000040108000 8K 8K 8K 8K 0K rwxp /usr/java/jdk1.6.0_31/bin/java
000000004010a000 2492K 2448K 2448K 2448K 0K rwxp [heap]
0000000683600000 23104K 11276K 11276K 11276K 0K rwxp [anon]
0000000684c90000 1728K 0K 0K 0K 0K ---p [anon]
..............................................
00007fff26dd6000 4K 4K 0K 0K 0K r-xp [vdso]
ffffffffff600000 4K 0K 0K 0K 0K r-xp [vsyscall]
Total: 6594996K 82020K 73089K 72296K 0K
6382660K writable-private, 209860K readonly-private, 2476K shared, and 82016K referenced
“writeable/private” 是包括虛擬內存,公共lib等的進程消耗,對於Java進程 無參考意義,the RSS(物理內存)是要關注的。
注意:該值不只是heap
The memory usage for the java process is more that just the Java heap. It consists of (hope it didn't forget anything):
the Java heap (where allocated objects go)the permgen (where static class data goes)the thread stacks (where method-local references, basic data values, and other information used to maintain method calling go)various other C/C++ data structures used by the JVM to do its jobthe binary code for the JVM and the libraries that it uses to do it jobthe binary, compiled code for the Java methodsjstat -gc PID