部分信息参考自:马士兵的JVM调优实战
垃圾回收算法:
1、标记清除
2、复制:缺点:浪费一半的空间
3、标记压缩(Mark Sweep)
对象的产生、分配和回收过程
TLAB: Thread Local Allocation Buffer:
Minor GC: 新生代
Major GC: 老年代
Full GC: 新生+老年
垃圾回收器:JDK1.8开始支持G1
垃圾回收器发展路线,随着内存越来越大而演进:从分代演化到不分代; Serial:几十M; Parallel:几个G; CMS: 几十个G
CMS: Concurrent Mark Sweep 第3列:简称PS&PO
Serial:a stop-the-world, copying collector which uses a signle GC thread
Parallel Scavenge:a stop-the-world, copying collector which uses multiple GC thread
Parallel Old:a compacting collector that uses multiple GC threads
ParNew: a stop-the-world, copying collector which uses multiple GC threads;it differs from "Paralledl Scavenge" in that it has enhancements that makes it useable with CMS(和CMS配对使用);
For example, ParNew does the synchronization needed so that it can run during the concurrent phases of CMS
CMS: concurrent mark sweep 非常重要的一个算法,面试重灾区; a mostly concurrent, low-pause collector(暂停时间短)
4 phases: 1.initial mark 2.concurrent mark 3.remark 4.concurent sweep
https://www.bilibili.com/video/BV1AZ4y147fD?p=3