Missing memory: size of young generation includes only one survivor space(内存缺失:年轻代的大小只包含一个幸存者空间)
问题描述
在 Java 堆上,我预计年轻一代的大小将是eden空间和两个幸存者空间(从空间和到空间):
On the Java heap, I expected that the size of the young generation would be the sum of the sizes of the eden space and both of the survivor spaces (from space and to space):
[young gen size] = [eden space size] + [from space size] + [to space size]
但是,GC 日志(使用 XX:+PrintHeapAtGC
)表明 young generation 的大小是 eden 空间大小的总和 并且只有幸存者空间之一:
However, GC logs (using XX:+PrintHeapAtGC
) state that the size of the young generation is the sum of the sizes of the eden space and only one of the survivor spaces:
[young gen size] = [eden space size] + [from space size]
为什么年轻代的大小只包括一个幸存者空间的大小?
可能是因为只有一个幸存者空间可用?但是两个幸存者空间都存在,所以两个幸存者空间都应该为新一代的规模做出贡献?
Maybe because only one of the survivor spaces is available at any time? But both survivor spaces exist so both survivor spaces should contribute to the size of the new generation?
GC 日志:
{Heap before GC invocations=48 (full 17):
par new generation total 943744K, used 891496K [0x000000073ae00000, 0x000000077ae00000, 0x000000077ae00000)
eden space 838912K, 100% used [0x000000073ae00000, 0x000000076e140000, 0x000000076e140000)
from space 104832K, 50% used [0x000000076e140000, 0x000000077149a040, 0x00000007747a0000)
to space 104832K, 0% used [0x00000007747a0000, 0x00000007747a0000, 0x000000077ae00000)
来自:
[young gen size] = [eden space size] + [from space size]
943744K = 838912K + 104832K
推荐答案
在任何时候,幸存者空间之一总是为空,因此不能被视为可用.
At any time one of the survivor spaces is always empty, so it cannot be considered available.
这篇关于内存缺失:年轻代的大小只包含一个幸存者空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:内存缺失:年轻代的大小只包含一个幸存者空间


- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01