java8默认垃圾回收器,Java 8的默认垃圾收集器

Java 8 的默认垃圾收集器对于服务器类机器是并行收集器(也称为吞吐量收集器),而对于客户端类机器则是串行收集器。由于大多数现代机器都拥有两个或更多CPU,因此通常被视为服务器类,故并行收集器被广泛认为是默认选择。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值