Java 8的默认垃圾收集器 [英] Default garbage collector for Java 8
问题描述
Java 8的默认垃圾回收器是什么?
当我查看JMX Beans时,他们发现它是新一代和旧版的并行收集器旧的一代串行收集器。
选择默认垃圾回收器(除其他外)就是所谓的人机工程学流程。这个过程取决于您的机器的类别。
- 对于服务器级机器,定义为具有2个或更多物理处理器和2个物理处理器的机器或更多GB的物理内存(不管平台),默认的垃圾收集器是(也称为吞吐量收集器)。
- 对于定义为Windows或单处理器计算机上的32位平台的客户机类计算机,默认的垃圾收集器是串行收集器。
由于几乎所有的机器都有2个或更多的CPU,由JVM分类。这就是为什么你会发现很多引用考虑到并行收集器是默认的垃圾收集器。
What is the default garbage collector for Java 8?
When I check the JMX Beans, they reveal it to be the parallel collector for the new generation and the old serial collector for the old generation.
解决方案Selecting the default garbage collector (among other things) is what's called the ergonomics process of the JVM. This process depends on the class of your machine.
- For server-class machine, defined as a machine with 2 or more physical processors and 2 or more GB of physical memory (regardless of the platform), the default garbage collector is the parallel collector (also known as throughput collector).
- For client-class machine, defined as a 32-bit platform on Windows or a single-processor machine, the default garbage collector is the serial collector.
Since practically all machines have 2 or more CPU, a machine is practically always considered server-class by the JVM. That's why you will find a lot of references considering the parallel collector to be the default garbage collector.
这篇关于Java 8的默认垃圾收集器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- 对于定义为Windows或单处理器计算机上的32位平台的客户机类计算机,默认的垃圾收集器是串行收集器。