并发标记和扫描算法细节 [英] Concurrent Mark and Sweep algorithm details

查看:119
本文介绍了并发标记和扫描算法细节的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. 初始标记

  2. 并发标记

  3. 并发预清理

  4. 重标记

  5. 扫描

  6. 并发重置

这些步骤在很短的地方就有很多地方进行了解释。但是如果我必须在图表和伪示例的类中描述它们,我可以从哪里获得这些信息?



PS - 我已经在Google上进行了大量搜索,它会抛出用我理解的很多文字和行话。但我正在寻找一个更加生动的解释,以便我可以教给我的观众。



这些是很受欢迎的一些链接,第3个非常有前途,但它未能特别解释CMS




  1. 与其前任

    http://insightfullogic.com/blog/2013/feb/20/garbage-collection-java-1

    http://insightfullogic.com/blog/2013/mar/ 6 / garbage-collection-java-2

    明确表示。我忘记了我也会阅读@gap_j上面提到的链接,这些链接都非常好。



    您问到了压缩步骤的位置,但CMS确实没有一个。这可能会导致它自己的问题,特别是它会增加分配内存的成本(因为JVM必须使用list来跟踪哪些内存是空闲的,并且不能仅仅从占用空间的末端分配内存)以及它有时可能意味着一个零散的堆。


    I am struggling to understand and get more details on the steps involved in CMS tenured collection cycles.

    1. Initial Mark
    2. Concurrent Mark
    3. Concurrent pre-clean
    4. Re-mark
    5. Concurrent Sweep
    6. Concurrent Reset

    These steps are explained in lot of places in very short. But if I have to describe them in a class with diagrams and psuedo-examples where can I get that information from?

    PS - I have searched extensively on Google, it throws up with a lot of textual stuff and jargon which I understand. But I am looking for a more animated explanation so that I can teach my audience.

    These are some of the links which are popular, the 3rd one was very promising but it failed to explain the CMS in particular

    1. http://www.infoq.com/articles/Java_Garbage_Collection_Distilled
    2. http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html
    3. http://www.cubrid.org/blog/dev-platform/understanding-java-garbage-collection/


    Dear all, thanks for commenting and pointing me to some resources. I have tried to create a visual representation of the CMS steps, can you please let me know if this matches your understanding ?

    Also I seem to be missing the Compacting step, which step does it belong to ?

    Answer : Ok so compacting is not handled by CMS, instead it is delegated to full GC.

    解决方案

    For me

    http://insightfullogic.com/blog/2013/may/7/garbage-collection-java-3

    with its predecessors

    http://insightfullogic.com/blog/2013/feb/20/garbage-collection-java-1
    http://insightfullogic.com/blog/2013/mar/6/garbage-collection-java-2

    made it clear. I'd forgotten that I'd also read the links mentioned by @gap_j above, which are very good too.

    You asked where the Compacting step is, but CMS does not have one. This can lead to its own issues, particularly it can increase the cost of allocating memory (because the JVM has to use list to keep track of which memory is free, and can't just allocate memory from the end of the occupied space) and it can sometimes mean a fragmented heap.

    这篇关于并发标记和扫描算法细节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆