Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
配置的 -Xmx 为 2037m (-Xmx2037),当从 Runtime.totalMemory() 获取总内存时,它给出了 136mb,我怎样才能获得精确配置的 xml 值?
使用Runtime.maxMemory,Runtime.totalMemory返回当前堆大小。
Runtime.maxMemory
Runtime.totalMemory
totalMemory报告当前堆大小,该大小仅根据需要向Xmx限制增长。maxMemory报告最大堆大小。
totalMemory
Xmx
maxMemory