Garbage Collection: Serial vs. Parallel vs. Concurrent-Mark-Sweep
来源:互联网 发布:java分解质因数算法 编辑:程序博客网 时间:2024/06/05 18:28
- the following collectors operate on the young generation:
-XX:+UseParallelGC
-XX:+UseParNewGC
- the following collectors operate on the old generation:
-XX:+UseConcMarkSweepGC
- what's the difference between the Serial and the Parallel collector?
so what's the difference between them?
a serial collector is a default copying collector which uses only one GC thread for the GC operation, while a parallel collector uses multiple GC threads for the GC operation.
- what's the difference between the Parallel and the CMS collector?
- initial mark
- concurrent marking
- remark
- concurrent sweeping
there are two differences between a parallel and a CMS collectors:
2) the parallel is a 'stop-the-world' collector, while the CMS stops the world only during the initial mark and remark phases.
during the concurrent marking and sweeping phases, the CMS thread runs along with the application's threads.
- if you wish to combine both parallelism and concurrency in your GC, you can use the following:
-XX:+UseConcMarkSweepGC for the old generation (one GC thread, freezes the JVM only during the initial mark and remark phases)
Young generation garbage collection algorithms
The (original) copying collector (Enabled by default). When this collector kicks in, all application threads are stopped, and the copying collection proceeds using one thread (which means only one CPU even if on a multi-CPU machine). This is known as a stop-the-world collection, because basically the JVM pauses everything else until the collection is completed.
The parallel copying collector (Enabled using -XX:+UseParNewGC). Like the original copying collector, this is a stop-the-world collector. However this collector parallelizes the copying collection over multiple threads, which is more efficient than the original single-thread copying collector for multi-CPU machines (though not for single-CPU machines). This algorithm potentially speeds up young generation collection by a factor equal to the number of CPUs available, when compared to the original singly-threaded copying collector.
The parallel scavenge collector (Enabled using -XX:UseParallelGC). This is like the previous parallel copying collector, but the algorithm is tuned for gigabyte heaps (over 10GB) on multi-CPU machines. This collection algorithm is designed to maximize throughput while minimizing pauses. It has an optional adaptive tuning policy which will automatically resize heap spaces. If you use this collector, you can only use the the original mark-sweep collector in the old generation (i.e. the newer old generation concurrent collector cannot work with this young generation collector).
XX:-UseParallelGC = Use parallel garbage collection for scavenges. (Introduced in 1.4.1).
-XX:-UseParallelOldGC = Use parallel garbage collection for the full collections. Enabling this option automatically sets -XX:+UseParallelGC. (Introduced in 5.0 update 6.)
where Scavenges = Young generation GC.
- Garbage Collection: Serial vs. Parallel vs. Concurrent-Mark-Sweep
- Mark-and-Sweep Garbage Collection
- mark-and-sweep garbage collection
- Mark-and-Sweep Garbage Collection
- Mark-and-Sweep Garbage Collection
- Mark-and-Sweep Garbage Collection
- Garbage Collection | Mark-Sweep算法
- Mark-sweep vs. copying collection and asymptotic complexity
- Garbage Collectors – Serial vs. Parallel vs. CMS vs. G1 (and what’s new in Java 8)
- Concurrent vs serial queues in GCD
- Concurrency vs Parallelism, Concurrent Programming vs Parallel Programming
- Concurrency vs Parallelism, Concurrent Programming vs Parallel Programming
- CMS(Concurrent Mark Sweep)收集器
- CMS(Concurrent Mark-Sweep)垃圾回收器
- Background sticky concurrent mark sweep GC
- 了解CMS(Concurrent Mark-Sweep)垃圾回收器
- 了解CMS(Concurrent Mark-Sweep)垃圾回收器
- 了解CMS(Concurrent Mark-Sweep)垃圾回收器
- 不调用C/C++库函数实现strcpy函数
- Android 开发中使用 SQLite 数据库
- ProtegeOWLTutorialP4_v1_3.pdf学习摘要
- android 裁剪图片大小 控制图片尺寸
- 关于ajax在IE下缓存的问题
- Garbage Collection: Serial vs. Parallel vs. Concurrent-Mark-Sweep
- java源代码阅读方法
- 【技术类】【且听我说“镶嵌数据集”】概述篇:影像管理的内容有哪些
- 24X24 黑体简体中文点阵字库
- web开发中页面跳转+超链接使用技巧
- 收集的材料 关于数据库和抓取器方面的
- Java 之 Annotation(注解)介绍
- 跨 服务器 访问数据
- 2011java 初赛真题