gc()两分钟了解JDK8默认垃圾收集器(附英文)
Hello!today let's try to know the default GC of JDK8.You know,在JDK8中JVM(Java Virtual Machine)的參數大概總數有1850多個,有詳細介紹的參數也有680之多。而這就包括使用默認垃圾收集器的參數,可以通過java -XX:+PrintCommandLineFlagsjvm -version命令打印出JDK默認使用的GC。如下圖:
The default GC of JDK8
上圖紅框的UseParallelGC就是Parallel Scavenge(新生代)+Parallel Old(老年代),也就是說:JDK8 默認垃圾收集器是Parallel Scavenge+Parallel Old。
Parallel Scavenge
The parallel collector (also known as the throughput collector) performs minor collections in parallel, which can significantly reduce garbage collection overhead. It is intended for applications with medium-sized to large-sized data sets that are run on multiprocessor or multithreaded hardware. The parallel collector is selected by default on certain hardware and operating system configurations, or can be explicitly enabled with the option -XX:+UseParallelGC.
Parallel Scavenge收集器(也稱為吞吐量收集器)以并行的方式執行小規模的收集,這可以顯著降低垃圾收集開銷。它適用于在多處理器或多線程硬件上運行的具有中等規模到大型數據集的應用程序。Parallel Scavenge在某些硬件和操作系統配置上是默認選擇的,或者可以通過選項-XX:+UseParallelGC明確啟用。
以上英文選自https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/collectors.html
well so much for today.thank you for watching.see you tomorrow.
總結
以上是生活随笔為你收集整理的gc()两分钟了解JDK8默认垃圾收集器(附英文)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 搞定常见垃圾收集器【Java】
- 下一篇: [网络]_获取内外网IP地址【Auto.