java的xms与xmx和服务器内存_来自Java的内存主机和内存参数xms和xmx之间的关系

I have the following host with the memory details:

$free -m

total used free shared buffers cached

Mem: 7872 7579 292 17 483 3983

-/+ buffers/cache: 3112 4759

Swap: 2047 14 2033

I have a java app running with the params -Xms200m -Xmx200m, could someone please explain me why the VCZ is 3800076 and the RSS is 241304 (which is more of the Java params)

from the ps -aux command:

66345 6773 0.2 2.9 3800076 241304 ? Sl Apr1 12:06 /apps/myapps/myapp1/java/bin/java -Xms200m -Xmx200m

解决方案

Memory used by Java process (as seen by the OS) is not only limited to Java Heap. There are a lot more memory areas that should be also counted:

Metaspace (where class metadata resides);

Code Cache (storage for JIT-compiled methods and all the generated code);

Direct ByteBuffers;

Memory-mapped files, including files mapped by JVM, e.g. all JAR files on the classpath;

Thread stacks;

JVM code itself and all the dynamic libraries loaded by Java Runtime;

Other internal JVM structures.

Use NativeMemoryTracking JDK feature to get the detailed breakdown of memory areas used by JVM:

java -XX:NativeMemoryTracking=detail -XX:+UnlockDiagnosticVMOptions -XX:+PrintNMTStatistics

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值