jmap -heap
时间: 2023-12-13 21:32:49 浏览: 100
数据结构--Heap
根据引用[1]中的jmap语法格式,jmap -heap命令可以用于打印Java进程的堆信息。具体来说,它将打印出Java堆的配置和使用情况,包括堆的总容量、已使用的容量、可用的容量等信息。以下是一个示例:
```shell
jmap -heap 12345
```
其中,12345是Java进程的PID。执行上述命令后,将会输出类似以下的信息:
```shell
Attaching to process ID 12345, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.191-b12
using thread-local object allocation.
Parallel GC with 4 thread(s)
Heap Configuration:
MinHeapFreeRatio = 0
MaxHeapFreeRatio = 100
MaxHeapSize = 2147483648 (2048.0MB)
NewSize = 1363144 (1.2999954223632812MB)
MaxNewSize = 17592186044415 MB
OldSize = 5452592 (5.1999969482421875MB)
NewRatio = 2
SurvivorRatio = 8
MetaspaceSize = 21807104 (20.796875MB)
CompressedClassSpaceSize = 1073741824 (1024.0MB)
MaxMetaspaceSize = 17592186044415 MB
G1HeapRegionSize = 0 (0.0MB)
Heap Usage:
PS Young Generation
Eden Space:
capacity = 536870912 (512.0MB)
used = 0 (0.0MB)
free = 536870912 (512.0MB)
0.0% used
From Space:
capacity = 0 (0.0MB)
used = 0 (0.0MB)
free = 0 (0.0MB)
0.0% used
To Space:
capacity = 0 (0.0MB)
used = 0 (0.0MB)
free = 0 (0.0MB)
0.0% used
PS Old Generation
capacity = 1073741824 (1024.0MB)
used = 0 (0.0MB)
free = 1073741824 (1024.0MB)
0.0% used
...
```
以上输出中包含了Java堆的配置和使用情况,以及Young Generation和Old Generation的使用情况等信息。
阅读全文