缺少内存:年轻一代的大小仅包括一个幸存者 space
Missing memory: size of young generation includes only one survivor space
在 Java 堆上,我 预计 年轻一代 的大小将是大小的总和伊甸园的 space 和 幸存者 spaces ( 从 space 和 到 space):
[young gen size] = [eden space size] + [from space size] + [to space size]
但是,GC 日志(使用 XX:+PrintHeapAtGC
)指出 年轻一代 的大小是 eden space和只有一个幸存者spaces:
[young gen size] = [eden space size] + [from space size]
为什么新生代的大小只包括一个survivor的大小space?
可能是因为任何时候幸存者space中只有一个可用?但是幸存者space都存在,所以两个幸存者space都应该贡献的大小]新一代?
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
在任何时候,其中一个幸存者空间总是空的,因此不能认为它可用。
在 Java 堆上,我 预计 年轻一代 的大小将是大小的总和伊甸园的 space 和 幸存者 spaces ( 从 space 和 到 space):
[young gen size] = [eden space size] + [from space size] + [to space size]
但是,GC 日志(使用 XX:+PrintHeapAtGC
)指出 年轻一代 的大小是 eden space和只有一个幸存者spaces:
[young gen size] = [eden space size] + [from space size]
为什么新生代的大小只包括一个survivor的大小space?
可能是因为任何时候幸存者space中只有一个可用?但是幸存者space都存在,所以两个幸存者space都应该贡献的大小]新一代?
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
在任何时候,其中一个幸存者空间总是空的,因此不能认为它可用。