摘自:《Java Performance》第三章
为什么在进行Full GC之前最好进行一次Minor GC?
Garbage collecting the young generation space prior to garbage collecting the old generation space usually results in less work for the garbage collector and more objects being garbage collected since objects in the old generation space may be holding object references to objects in the young generation space. If the young generation space is not garbage collected, any object in old generation space that holds a reference to an object in young generation space cannot be garbage collected.
本文摘自《JavaPerformance》第三章,解释了在进行FullGC之前先进行一次MinorGC的原因,即可以减少垃圾收集的工作量并提高对象的回收效率。文中提到,年轻代空间的垃圾收集有助于释放被老代对象引用的对象,从而更有效地进行垃圾回收。
12万+

被折叠的 条评论
为什么被折叠?



