查看JVM各个代的内存状态

26 篇文章 0 订阅
 
 
//在Linux执行 jmap -heap [pid]
//可以看到如下信息
Attaching to process ID 23990, please wait...
Warning: the type "const char*" (declared in the remote VM in VMStructs::localHotSpotVMTypes) had its size declared as 8 twice. Continuing.
Warning: the type "const size_t" (declared in the remote VM in VMStructs::localHotSpotVMTypes) had its size declared as 8 twice. Continuing.
Warning: the type "const int" (declared in the remote VM in VMStructs::localHotSpotVMTypes) had its size declared as 4 twice. Continuing.
Warning: the type "const MemRegion" (declared in the remote VM in VMStructs::localHotSpotVMTypes) had its size declared as 16 twice. Continuing.
Debugger attached successfully.
Server compiler detected.
JVM version is 21.0-b17
using parallel threads in the new generation.
using thread-local object allocation.
Concurrent Mark-Sweep GC
Heap Configuration:
MinHeapFreeRatio = 40
MaxHeapFreeRatio = 70
MaxHeapSize = 5368709120 (5120.0MB)
NewSize = 1073741824 (1024.0MB)
MaxNewSize = 1073741824 (1024.0MB)
OldSize = 5439488 (5.1875MB)
NewRatio = 2
SurvivorRatio = 8
PermSize = 536870912 (512.0MB)
MaxPermSize = 536870912 (512.0MB)
Heap Usage:
New Generation (Eden + 1 Survivor Space):
capacity = 966393856 (921.625MB)
used = 282829160 (269.7269058227539MB)
free = 683564696 (651.8980941772461MB)
29.266448482056575% used
Eden Space:
capacity = 859045888 (819.25MB)
used = 203344848 (193.9247589111328MB)
free = 655701040 (625.3252410888672MB)
23.671011157904523% used
From Space:
capacity = 107347968 (102.375MB)
used = 79484312 (75.8021469116211MB)
free = 27863656 (26.572853088378906MB)
74.04361114688263% used
To Space:
capacity = 107347968 (102.375MB)
used = 0 (0.0MB)
free = 107347968 (102.375MB)
0.0% used
concurrent mark-sweep generation:
capacity = 4294967296 (4096.0MB)
used = 46904664 (44.731773376464844MB)
free = 4248062632 (4051.268226623535MB)
1.0920843109488487% used
Perm Generation:
capacity = 536870912 (512.0MB)
used = 81989448 (78.19123077392578MB)
free = 454881464 (433.8087692260742MB)
15.27172476053238% used
 
导出整个JVM的内存
jmap -dump:format=b,file=memory.log [pid]
 
使用JHat分析JVM堆dump文件的工具,基于此工具可以分析JVM heap中对象占用状况
jhat -J-Xmx1024M [file]
执行后等待console中输出Started HTTP server on port 7000
然后就可以使用浏览器访问HTTP://ip:7000
 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值