Java9 默認的GC收集器是?

我們在介紹了Java8的默認收集器ParallelGC後, 很多人就繼續追問那Java9默認使用哪種收集器呢?

直接看官方文檔(https://docs.oracle.com/javase/9/whatsnew/toc.htm#JSNEW-GUID-B6CD8C25-FD93-4CAA-9286-19A39CC0F26A),

其中一段
Makes Garbage-First (G1) the default garbage collector (GC) on 32- and 64-bit server configurations. Using a low-pause collector such as G1 provides a better overall experience, for most users, than a throughput-oriented collector such as the Parallel GC, which was previously the default.
See Garbage-First Garbage Collector in Java Platform, Standard Edition HotSpot Virtual Machine Garbage Collection Tuning Guide

在這裏插入圖片描述

Java9默認使用期待已久的G1, 同時刪除了好多之前的jvm垃圾收集器組合與參數,例如ParNew + SerialOld這種組合就不存在了,CMS這樣的參數-XX:+CMSFullGCsBeforeCompaction(原來的含義是執行多少次不壓縮的Full GC後,跟着來一次壓縮的,默認值爲0, 表示每次Full GC都進行GC整理)。

關於G1收集器的詳細內容,可以閱讀https://docs.oracle.com/javase/9/gctuning/garbage-first-garbage-collector.htm#JSGCT-GUID-ED3AB6D3-FD9B-4447-9EDF-983ED2F7A573。

JDK的主要文檔都可以在找到 https://docs.oracle.com/en/java/javase/index.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章