简体   繁体   中英

Why is CMS full GC single-threaded?

Whenever there's concurrent mode failure or promotion failure using CMS it does full GC using single thread. Why it couldn't do full GC using parallel collector to decrease the full GC penalty?

There is no particular reason other than that it hasn't been implemented that way and engineering effort is focused on G1. Most users of CMS just try to tune it in a way that it never happens, "never" meaning at an interval greater than whatever requires JVM restarts anyway. The parallel old collector can't be reused by simply calling its code since internal data structurs between the collectors differ, so it would involve non-trivial implementation effort.

Google devs have proposed a patch to contribute parallel full GC to CMS, but i wouldn't count on it becoming available in any openjdk builds anytime soon.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM