当前位置:网站首页>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 !!!
边栏推荐
- [machine learning] learning notes 01- introduction
- MySQL介绍和安装(一)
- Logstash timestamp converted to UNIX nanosecond nano second time
- Why is pain rating important?
- Vagrantbox reinstalling the vboxsf driver
- SQL tuning guide notes 9:joins
- 经济学人聚焦WTO MC12:数字经济或成重要议题
- Permission to query execution plan in Oracle Database
- #yyds干货盘点# 解决剑指offer:字符流中第一个不重复的字符
- Xingda easy control modbustcp to profibusdp
猜你喜欢

How to write a vscode plug-in by yourself to realize plug-in freedom!

Yyds dry inventory insider news: Series high-frequency interview questions, worth a visit!

Design and practice of Hudi bucket index in byte skipping

MySQL介绍和安装(一)

Use group_ Dplyr issues when using group_ by(multiple variables)

JVisualVM初步使用

SQL调优指南笔记9:Joins

Ansible playbook and ansible roles (III)

建立高可用的数据库

【数据分析】基于 kmeans实现数据聚类分组含Matlab源码
随机推荐
NoSQL - redis configuration and optimization (II) high availability, persistence and performance management
Oracle LiveLabs实验:Introduction to Oracle Spatial Studio
How to specify your webpage's language so Google Chrome doesn't offer to translate it
Ansible playbook and variable (II)
Why is pain rating important?
[probability theory and mathematical statistics] final review: formula summary and simple examples (end)
Ansible基础和常用模块(一)
Palindrome linked list and linked list intersection problem (intersecting with Xinyi people) do you really know?
LNMP platform docking redis service
Logstash timestamp converted to UNIX nanosecond nano second time
Can tonghuashun open an account? Is it safe to open an account in tonghuashun? How to open a securities account
Is it safe to open an account in tonghuashun? How to open an account
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 17:importing and exporting optimizer statistics
六月集训(第10天) —— 位运算
Compiling process of OpenSSL and libevent on PC
logstash时间戳转换为unix 纳秒nano second time
Okio source code analysis
Preliminary use of jvisualvm