Garbage Collection 进程中存储的引用对象的 "age threshold" 存储在哪里?

Where is the "age threshold" for the referenced object stored in Garbage Collection process stored?

我正在尝试了解 GC 的工作原理并一直在阅读 https://www.oracle.com/webfolder/technetwork/tutorials/obe/java/gc01/index.html

垃圾收集过程,第 6 点说,

“经过minor GC后,当老化的对象达到一定的年龄阈值(本例中为8)时,它们就会从年轻代提升到老年代。”

我想了解引用对象的“年龄阈值”存储在哪里?

此信息存储在任何 java Object 具有的两个 headers 之一中。如何存储的信息可以是read from the comments under the source code.

您甚至可以使用很棒的 JOL 库跟踪这些位并查看它们如何从升级到升级发生变化。参见 this, as an example