Java虚拟机(JVM)堆大小不符合要求。

huangapple go评论58阅读模式
英文:

The JVM heap size does not add up

问题

我使用Java 8 JVM并添加了VM参数:

-Xms10M -Xmx10M

堆的结构如下:

PSYoungGen:2048K
   eden空间:1024K
   from空间:1024K
   to空间:1024K

ParOldGen:总共:7168K

我的问题是:

  1. 为什么eden + from + to的大小不等于PSYoungGen?我认为它们共同构成了年轻代。
  2. 为什么PSYoungGen + ParOldGen的大小等于9M?另外的1M堆空间在哪里?
英文:

I started a Java 8 JVM with VM param:

-Xms10M -Xmx10M

The structure of the heap is like this:

PSYoungGen: 2048K
   eden space: 1024K
   from space: 1024K
   to space: 1024K

ParOldGen: total: 7168K

My questions are:

  1. Why eden+from+to is not equal to PSYoungGen? I think they both made up young generation.
  2. Why PSYoungGen + OldGen = 9M? where is the other 1M heap?

答案1

得分: 1

这显示的是“大小”,而不是占用情况。在任何给定的时间点,一个“Survivor”空间是“空的”,因此:

PSYoungGen = “伊甸园空间”(1024K)+ 两个“from/to空间”中的一个(1024K)

两个“Survivor”空间仍然需要保留空间,“ParOldGen”就是所谓的“剩余空间”,即10M-3M(伊甸园和两个Survivor空间)。我想这只是关于你如何阅读它以及如何解释它的问题…

英文:

That shows the sizes, not the occupancy. At any given point in time, one Survivor spaces is empty, so :

PSYoungGen = "eden space" (1024K) + one of the two "from/to space" (1024K)

Both Survivor spaces still need space reserved, and ParOldGen is what is "left", which is 10M-3M (eden and two survivor spaces). I guess this is just about how you read that and how you interpret it...

huangapple
  • 本文由 发表于 2020年10月16日 06:16:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/64380400.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定