Runtime.maxMemory()和-Xmx [英] Runtime.maxMemory() and -Xmx
本文介绍了Runtime.maxMemory()和-Xmx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我期待Runtime.maxMemory()完全返回-Xmx但它返回一个较低的值。
那么它返回什么?
I was expecting Runtime.maxMemory() to return exactly the -Xmx but it returns a lower value. So what does it return?
推荐答案
-Xmx标志的解释是VM-依赖。一些虚拟机,包括HotSpot在内的
,对此选项的
的有效值强制执行下限。 CCC提案不应该以这种方式提及-Xmx标志
。
The interpretation of the -Xmx flag is VM-dependent. Some VMs, including HotSpot, enforce a lower bound on the effective value of this option. The CCC proposal should not have mentioned the -Xmx flag in this way.
这篇关于Runtime.maxMemory()和-Xmx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文