java - 为什么老年代垃圾回收效率比新生代低很多?
迷茫
迷茫 2017-04-17 14:29:05
0
1
494

看过深入理解java虚拟机,书上这个问题以结论性的一句话带过了,面试的时候被问到了这个问题,老年代对象生存时间长,不容易被回收,所以效率低?感觉怪怪的

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
黄舟

From the perspective of chronology, I think the problem is putting the cart before the horse. The purpose of chronology is to distinguish long-term objects from short-term objects.
Objects may survive for a long time, so they are put into the old generation. After marking and sorting, because the objects in the old generation have a high probability of continuing to survive, less memory will be recycled.
New objects may live and die. If new objects have an 80% probability of dying, after multiple rounds of screening, the surviving objects will be stored in the old generation. So from this process, the efficiency of object recycling in the old generation is really low.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!