At initialization of the virtual machine, the entire space for the heap is reserved. The size of the space reserved can be specified with the -Xmx option.
If the value of the -Xms parameter is smaller than the value of the -Xmx parameter, not all of the space that is reserved is immediately committed to the virtual machine.
The uncommitted space is labeled "virtual" in this figure. The different parts of the heap (permanent generation, tenured generation, and young generation) can grow to the limit of the virtual space as needed.
其中内部各部分的大小也可以设置。
一般建议固定大小,不要让虚拟机在调整大小上浪费性能。
Java垃圾回收——设置内存大小
最新推荐文章于 2023-03-08 17:39:27 发布
本文介绍了Java虚拟机(JVM)堆的初始化过程及其空间管理方式。通过-Xmx和-Xms参数可以设置最大和初始堆空间。当-Xms小于-Xmx时,并非所有空间立即分配给JVM,未分配的空间标记为虚拟。随着永久代、老年代及新生代的需求增长,这些区域会扩展至虚拟空间限制。
5万+

被折叠的 条评论
为什么被折叠?



