为了确定通过其他的什么方式我们才能得到100ms的停机时间,我们需要理解G1 内存管理行为上的更多细节。下面这张图展示了G1 在Young代回时如何工作。
Figure 5: Slide from the 2012 JavaOne presentation by Charlie Hunt and Monica Beckwith: “G1 Garbage Collector Performance Tuning”
当JVM基于参数启动,它会向操作系统申请一大块连续的内存空间来装载JVM Heap。这个大块连续的内存空间被分割成了JVM中的一个个Region。
Figure 6: Slide from the 2012 JavaOne presentation by Charlie Hunt and Monica Beckwith: “G1 Garbage Collector Performance Tuning”