我试图了解我应该在nmap输出中检查哪些值来检测JVM是否接近抛出OutOfMemoryError。
例如在jmap -heap pid
可以是价值的组合(接近或已达到100%)?
jmap -heap pid
有一个名为Heap Usage
的字段:
Heap Usage:
PS Young Generation
Eden Space:
capacity = 560988160 (535.0MB)
used = 193192264 (184.24250030517578MB)
free = 367795896 (350.7574996948242MB)
34.43785052433192% used
From Space:
capacity = 40370176 (38.5MB)
used = 40357616 (38.48802185058594MB)
free = 12560 (0.0119781494140625MB)
99.96888792359984% used
To Space:
capacity = 52953088 (50.5MB)
used = 0 (0.0MB)
free = 52953088 (50.5MB)
0.0% used
PS Old Generation
capacity = 783286272 (747.0MB)
used = 35294904 (33.65984344482422MB)
free = 747991368 (713.3401565551758MB)
4.506003138530685% used
所以你可以看到使用百分比。