[英]Runtime.totalMemory() gives me a wrong value from configured -Xmx value in 64 bit jvm
Configured -Xmx is 2037m (-Xmx2037), when getting total memory from 配置-Xmx为2037m(-Xmx2037),从中获取总内存
Runtime.totalMemory() it gives 136mb, How can i get exact configured xmx value? Runtime.totalMemory()它给出136mb,我怎样才能得到精确配置的xmx值?
使用Runtime.maxMemory
, Runtime.totalMemory
返回当前堆大小。
totalMemory
reports the current heap size, which grows only as needed towards the Xmx
limit. totalMemory
报告当前堆大小,该大小仅在需要时Xmx
限制。 maxMemory
reports the maximum heap size. maxMemory
报告最大堆大小。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.