gpt4 book ai didi

java - jmap中显示的 "From Space"和 "To Space"是什么意思?

转载 作者:IT王子 更新时间:2023-10-28 23:31:46 29 4
gpt4 key购买 nike

我了解 new gen/old gen/perm gen 之间的区别,但我不知道“To Space”和“From Space”是什么。我看到我的“From Space”使用率达到 99.8%,而“To Space”似乎始终保持在 0% 的使用率。

最佳答案

VM 中使用的垃圾收集算法中的两个区域。

Java 细节可在此处找到:How Garbage Collection works in Java

以及关于“从太空”和“到太空”的一般解释:WP

The most straightforward approach is the semi-space collector, which dates to 1969. In this moving GC scheme, memory is partitioned into a "from space" and "to space". Initially, objects are allocated into "to space" until they become full and a collection is triggered. At the start of a collection, the "to space" becomes the "from space", and vice versa. The objects reachable from the root set are copied from the "from space" to the "to space"

您的“到空间”为 0% 的原因是,除了收集期间,只使用其中一个;当收集完成并且所有 obj 都在“to space”中时,名称将被交换,“to space”现在称为“from space”。

关于java - jmap中显示的 "From Space"和 "To Space"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15122502/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com