10

GC日志解读与分析(实例分析中篇)

 3 years ago
source link: https://kimmking.blog.csdn.net/article/details/108728964
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

CMS 的 GC 日志解读

CMS 也可称为“并发标记清除垃圾收集器”。其设计目标是避免在老年代 GC 时出现长时间的卡顿。默认情况下,CMS 使用的并发线程数等于 CPU 内核数的 1/4。

通过以下选项来指定 CMS 垃圾收集器:

-XX:+UseConcMarkSweepGC

如果 CPU 资源受限,CMS 的吞吐量会比并行 GC 差一些。示例:

和前面分析的串行 GC/并行 GC 一样,我们将程序启动起来,看看 CMS 算法生成的 GC 日志是什么样子:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK