缺少记忆:年轻一代的规模只包括一个幸存者空间 [英] Missing memory: size of young generation includes only one survivor space

查看:94
本文介绍了缺少记忆:年轻一代的规模只包括一个幸存者空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Java堆上,预计 年轻代的大小将是 eden空间的大小之和生存空间 空间空间):

  [young gen size] = [eden space size] + [from space size] + [to space size] 

然而,GC日志(使用 XX:+ PrintHeapAtGC )声明年轻一代 eden space 其中一个生存空间 的大小之和:

  [young gen size] = [eden space size] + [from space size] 

为什么年轻一代的规模只包括一个幸存者空间的大小?



也许是因为只有其中一个存活空间可用在任何时候?但是,两个幸存者空间存在,所以这两个幸存者空间应该对新一代的大小有贡献

GC日志:

  {Heap before GC invocations = 48(full 17):
par new使用891496K [0x000000073ae00000,0x000000077ae00000,0x000000077ae00000)
eden space 838912K,使用100%[0x000000073ae00000,0x000000076e140000,0x000000076e140000) b $ b到空间104832K,使用0%[0x00000007747a0000,0x00000007747a0000,0x000000077ae00000)

从中

  [年龄gen size] = [伊甸园空间大小] + [from space size] 
943744K = 838912K + 104832K


解决方案

在任何时候,其中一个幸存者空间总是空的,所以它不能被认为是可用的。


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]

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]

Why does the size of the young generation only include the size of one survivor space?

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 log:

{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)

From which:

[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.

这篇关于缺少记忆:年轻一代的规模只包括一个幸存者空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆