我正在研究Java(JDK 6 HotSpot JVM)的垃圾回收。我有几个问题,希望社区能够帮助我解决。
我的理解:
1)堆被划分为
a)年轻代-伊甸园和幸存者:新对象和数组会创建到年轻代中。小的垃圾回收将在年轻代中进行。那些还活着的对象将被从伊甸园空间移动到幸存者空间。
b)老年代/终身代:大规模的垃圾回收将从年轻代将这些还活着的对象移到老年代。
2)非堆被划分为
a)Code Cache
b)Perm generation.
我想知道的是:
1)what if survivor gets full..how will minor garbage collection work.
2)When and how is the perm generation garbage collected.
3)Also what happens to the stack..where is it stored or residing?How is its size controlled?