Is Concurrent Mark Sweep (CMS) a stop the world event?

后端 未结 3 1713
礼貌的吻别
礼貌的吻别 2020-12-15 08:18

I see many unloading of classes and my entire system will hang during that period of time..

[Unloading class sun.reflect.GeneratedMethodAccessor117]
[Unloadi         


        
3条回答
  •  一个人的身影
    2020-12-15 09:07

    CMS is a type of GC and is divided into phases

    enter image description here

    As you can see two phases - Initial mark and Remark are stop the world events.

    Source : Under Reviewing Generational GC and CMS section.

    Does it happen even when the perm space is not full?
    

    AFAIK for this you should have CMSClassUnloadingEnabled with UseConcMarkSweepGC. And FGC will be triggered when permgen area reaches it's threshold.

    Also though Concurrent Sweep(phrase (4)) is not STW event if permgen area get filled up(and GC is still processing permgen area) it may led to stopping all process threads and only GC thread running till all required memory is reclaimed.

提交回复
热议问题