当前位置:网站首页>JVM foundation - > What garbage collectors does the JVM have?
JVM foundation - > What garbage collectors does the JVM have?
2022-06-12 22:09:00 【Ouhuang xiaodezi】
JVM What garbage collectors are there ?
The first stage :
Serial ( Serial ) The collector-> Time in JDK1.3 about
new ⽣ generation (Serial— Mark - Copy algorithm ) ⽼ years (SerialOld— Mark - Sorting algorithm ) -> The opening configuration is as follows ↓
-XX:+UseSerialGC
The second stage :
Parallel ( parallel ) The collector-> JDK 6 Only then did China begin to offer ,JDK 8 By default
Parallel Collector is also called throughput collector , Use multithreading to clean up garbage
new ⽣ generation (Parallel— Mark - Copy algorithm ) ⽼ years (ParallelOld— Mark - Sorting algorithm ) -> The opening configuration is as follows ↓
-XX:+UseParallelGC -XX:+UseParallelOldGC
The third stage :
CMS( Concurrent ) The collector-> JDK 5 appear ,JDK 9 Has been abolished CMS Garbage collector
CMS The collector Minor( The younger generation ) GC Time meeting
Pause all application threads, And in a multi-threaded way for garbage collection .In the old age GC when
No longer pause the application thread, Instead, several background threads are used to scan the space of the elderly on a regular basis , Recycle the objects that are no longer used in time .new ⽣ generation (ParNew— Mark - Copy algorithm ) ⽼ years (ConcMarkSweep— Mark - Clear algorithm ) -> The opening configuration is as follows ↓
-XX:+UseParNewGC -XX:+UseConcMarkSweepGC
The fourth stage :
G1( Concurrent ) The collector-> JDK 8 Then widely used ,JDK 9 The default with G1 The collector
G1 The collector ( Or garbage priority collector ) The original intention of the design is to
Try to shortenHandle Super pile ( Greater than 4GB) A pause when .be relative to CMS In terms of the advantages of
Reduce memory fragmentation.Mark - Copy algorithm + Mark - Sorting algorithm -> The opening configuration is as follows ↓
-XX:+UseG1GC
Be careful :
parallel GC: Multiple garbage collection threads operate simultaneously
Concurrent GC: Garbage collection threads work with user threads
Serial GC: A garbage collection thread
give the thumbs-up , handsome young man !!!
边栏推荐
- Modstartcms modular station building system v3.3.0 component function upgrade, event triggering enhancement
- 多线程模型下的生产者消费者模式
- How to perform disaster recovery and recovery for kubernetes cluster? (22)
- Is it safe to open an account in tonghuashun? How to open an account
- 孙老师版本JDBC(2022年6月12日21:34:25)
- 【概率论与数理统计】期末复习抱佛脚:公式总结与简单例题(完结)
- One article to quickly understand whether there are security risks in your network
- SQL调优指南笔记6:Explaining and Displaying Execution Plans
- Build a highly available database
- SQL tuning guide notes 13:gathering optimizer statistics
猜你喜欢

How to prevent phishing emails? S/mime certificate to help!

SQL tuning guide notes 14:managing extended statistics

PCB package download website recommendation and detailed usage

最近公共祖先问题你真的学会了吗?

SQL tuning guide notes 11:histograms

Producer consumer model under multithreading model

Dolphin-2.0.3 cluster deployment document

Ansible PlayBook et ansible roles (3)

关于 安装Qt5.15.2启动QtCreator后“应用程序无法正常启动0xc0000022” 的解决方法

Preliminary use of jvisualvm
随机推荐
[sword finger offer] sword finger offer 58 - ii Rotate string left
Ansible基础和常用模块(一)
IPhone: save Boolean into core data - iphone: save Boolean into core data
Qt Quick 3D学习:鼠标拾取物体
Oracle LiveLabs实验:Introduction to Oracle Spatial Studio
Open source background management system suitable for outsourcing projects
June training (day 11) - matrix
June training (day 12) - linked list
SQL query list all views in SQL Server 2005 database - SQL query to list all views in an SQL Server 2005 database
June training (day 10) - bit operation
SQL tuning guide notes 14:managing extended statistics
生成小程序菊花码(生成菊花码、更换中间logo、更改图片尺寸,加文字)
关于 安装Qt5.15.2启动QtCreator后“应用程序无法正常启动0xc0000022” 的解决方法
Things about the kotlin collaboration process - pipeline channel
The 2023 campus recruitment officially opened! Oceanbase would like to make an interview with you this spring
Qt Quick 3D学习:使用鼠标键盘控制节点位置和方向
USB机械键盘改蓝牙键盘
How to write a vscode plug-in by yourself to realize plug-in freedom!
SQL tuning guide notes 9:joins
[probability theory and mathematical statistics] final review: formula summary and simple examples (end)