Skip to content
欢迎扫码关注公众号

JEP 291: Deprecate the Concurrent Mark Sweep (CMS) Garbage Collector | 弃用并发标记清除(CMS)垃圾收集器

摘要

计划废弃并停止在未来的主要版本中支持并发标记清除(CMS)垃圾收集器。

目标

加快 HotSpot 中其他垃圾收集器的开发。

动机

停止对 CMS 的支持,然后删除 CMS 代码,或者至少更彻底地隔离它,将减少 GC 代码库的维护负担并加速新的开发。从长远来看,G1 垃圾收集器旨在取代大多数 CMS 的用途。

描述

废弃 CMS,以便在通过命令行使用 -XX:+UseConcMarkSweepGC 选项请求时发出警告消息。

这个 JEP 没有指定停止支持 CMS 的主要版本。决定何时停止支持将受到 G1 收集器是否能够很好地替代 CMS 的程度所影响。与此同时,鼓励 CMS 用户迁移到 G1 收集器(-XX:+UseG1GC)。

测试

验证当请求 CMS 收集器时是否发出了预期的弃用消息。

风险和假设

  • 对于某些应用程序,CMS 非常合适,可能始终优于 G1。
  • 当结束对 CMS 的支持时,CMS 将不会在新版本中可用。

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.