- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我的 jdk 版本是:
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
这是我的测试代码:
List<GarbageCollectorMXBean> beans = ManagementFactory.getGarbageCollectorMXBeans();
for (GarbageCollectorMXBean bean : beans) {
System.out.println(bean.getName());
}
结果是:
PS Scavenge
PS MarkSweep
我知道 PS Scavenge 是年轻代垃圾收集器的“Parallel Scavenge”,“PS MarkSweep”是哪个,它是“Parallel Old”吗?
最佳答案
为了其他人找到这个问题的好处,这里有一个很好的概述:
http://www.fasterj.com/articles/oraclecollectors1.shtml
引用这个问题的相关部分:
Young generation collectors
Copy (enabled with -XX:+UseSerialGC)
the serial copy collector, uses one thread to copy surviving objects from Eden to Survivor spaces and between Survivor spaces until it decides they've been there long enough, at which point it copies them into the old generation.PS Scavenge (enabled with -XX:+UseParallelGC)
the parallel scavenge collector, like the Copy collector, but uses multiple threads in parallel and has some knowledge of how the old generation is collected (essentially written to work with the serial and PS old gen collectors).ParNew (enabled with -XX:+UseParNewGC)
the parallel copy collector, like the Copy collector, but uses multiple threads in parallel and has an internal 'callback' that allows an old generation collector to operate on the objects it collects (really written to work with the concurrent collector).G1 Young Generation (enabled with -XX:+UseG1GC)
the garbage first collector, uses the 'Garbage First' algorithm which splits up the heap into lots of smaller spaces, but these are still separated into Eden and Survivor spaces in the young generation for G1.Old generation collectors
MarkSweepCompact (enabled with -XX:+UseSerialGC)
the serial mark-sweep collector, the daddy of them all, uses a serial (one thread) full mark-sweep garbage collection algorithm, with optional compaction.PS MarkSweep (enabled with -XX:+UseParallelOldGC)
the parallel scavenge mark-sweep collector, parallelised version (i.e. uses multiple threads) of the MarkSweepCompact.ConcurrentMarkSweep (enabled with -XX:+UseConcMarkSweepGC)
the concurrent collector, a garbage collection algorithm that attempts to do most of the garbage collection work in the background without stopping application threads while it works (there are still phases where it has to stop application threads, but these phases are attempted to be kept to a minimum). Note if the concurrent collector fails to keep up with the garbage, it fails over to the serial MarkSweepCompact collector for (just) the next GC.G1 Mixed Generation (enabled with -XX:+UseG1GC)
the garbage first collector, uses the 'Garbage First' algorithm which splits up the heap into lots of smaller spaces.
关于java - PS MarkSweep 是哪个垃圾收集器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39929758/
我的 jdk 版本是: java version "1.8.0_102" Java(TM) SE Runtime Environment (build 1.8.0_102-b14) Java HotS
我已通过此 source 在我的 CentOS 操作系统上安装了单声道版本 4.2.1.60首先下载 tarball,然后对提取的源文件执行 sudo ./configure、sudo make 和
我已将 Spark 配置为在两个节点上运行,HDFS 托管输入文件。我想将metrics.properties 提供的所有统计文件转储到HDFS 或每个节点的本地目录。 这是我对metrics.pro
我是一名优秀的程序员,十分优秀!