gc 算法的关键

The best garbage collection routines known have an execution time essentially of the form c_1N + c_2M, where c_1 and c_2 are constants, N is the number of nodes marked, and M is the total number of nodes in the memory. Thus M-N is the number of free nodes found, and the amount of time required to return these nodes to free storage is (c_1N + c_2M)/(M-N) per node.

Hence we can see to what extent garbage collection is inefficient when memory becomes full, and how it is correspondingly efficient when the demand on memory is light.

https://tech.meituan.com/2016/09/23/g1.html

agc 算法种类

gc 算法标记方法

gc 算法的 stw

https://zhuanlan.zhihu.com/p/30175684

在 Java 语言里,可作为 GC Roots 的对象包括以下几种?

  1. 虚拟机栈(栈帧中的本地变量表)中引用的对象。
  2. 方法区中的类静态属性引用的对象。
  3. 方法区中常量引用的对象。
  4. 本地方法栈中 JNI(即一般说的 Native 方法)中引用的对象。

https://medium.com/software-under-the-hood/under-the-hood-java-peak-safepoints-dd45af07d766

分代回收