英文:
The JVM heap size does not add up
问题
我使用Java 8 JVM并添加了VM参数:
-Xms10M -Xmx10M
堆的结构如下:
PSYoungGen:2048K
eden空间:1024K
from空间:1024K
to空间:1024K
ParOldGen:总共:7168K
我的问题是:
- 为什么eden + from + to的大小不等于PSYoungGen?我认为它们共同构成了年轻代。
- 为什么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:
- Why eden+from+to is not equal to PSYoungGen? I think they both made up young generation.
- 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...
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论