Concurrent Mark and Sweep algorithm details(并发标记和扫描算法详细信息)
问题描述
我正在努力了解和获取有关 CMS 终身收集周期中涉及的步骤的更多详细信息.
- 首字母标记
- 并发标记
- 并发预清理
- 重新标记
- 并发扫描
- 并发重置
在很多地方都非常简短地解释了这些步骤.但是,如果我必须在带有图表和伪示例的类中描述它们,我可以从哪里获得这些信息?
PS - 我在 Google 上进行了广泛搜索,其中包含很多我理解的文字内容和行话.但我正在寻找更生动的解释,以便我可以教给我的听众.
这些是一些流行的链接,第三个很有希望,但它没有特别解释 CMS
-
与其前辈
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.
- Initial Mark
- Concurrent Mark
- Concurrent pre-clean
- Re-mark
- Concurrent Sweep
- 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
- http://www.infoq.com/articles/Java_Garbage_Collection_Distilled
- http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html
- 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-2made 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.
这篇关于并发标记和扫描算法详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:并发标记和扫描算法详细信息
基础教程推荐
- Java:带有char数组的println给出乱码 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 降序排序:Java Map 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01