当前位置:网站首页>Minorgc, majorgc, fullgc
Minorgc, majorgc, fullgc
2022-06-29 10:03:00 【Hao_ JunJie】
One 、 Concept :
JVM It's going on GC when , Not every time , Old age , Method area , Three memory areas are reclaimed together , Most of the time recycling refers to the new generation .
Two 、 classification :
in the light of HotSpot VM The implementation of the , It's inside GC According to the recycling area, it is divided into two categories :
One is Part of the collection (Partial GC), One is Collect the whole pile (Full GC).
Part of the collection ( Not the whole collection Java Garbage collection ) It is divided into :
a. Cenozoic collection (Minor GC / Young GC): It's just a new generation of garbage collection .
b. Old age collection (Major GC/ Old GC): It's just garbage collection in the old days .
At present, only CMS GC Will collect the behavior of old age separately .
Be careful : A lot of times Major GC Hui He Full GC To confuse with , It is necessary to specifically distinguish whether it is an old-fashioned collection or a whole stack collection
c. Mixed collection (Mixed GC) : Collect the collection of the whole Cenozoic and some old ages .( at present , Only G1 GC There's going to be this kind of behavior )
Collect the whole pile (Full GC): Collect the whole java Garbage collection in the heap and method area .
3、 ... and GC The trigger condition :
( One ) The younger generation GC(Minor GC) The trigger condition :
a. When there was not enough space for the younger generation , It will trigger Minor GC, The young generation here refers to Eden When the area is full ,Survivor Full will not trigger GC( Every time Minor GC Will clean up the memory of the younger generation )
b. because Java Most of the objects have the characteristics of living and dying , therefore Minor GC Very often , Generally, the recovery speed is relatively high .
c.Minor GC May trigger STW, Pause other users' threads , When the garbage collection is over , The user thread will resume running .
( Two ) Old age GC (Major GC) Trigger mechanism :
a. Of or occurring in old age GC, When objects disappear from the old age , We said “Major GC” or “Full GC” It happened. .
b. appear Major GC, Often accompanied by at least once Minor GC( But not absolutely , stay Parallel Scavenge In the collection strategy of the collector, there is a direct process Major GC The strategic choice of .)
When the space for the elderly generation is insufficient , Will try to trigger Minor GC. If there's not enough space after that , The trigger Major GC
c.Major GC It's usually faster than Minor GC slow 10 times above ,STW Longer time .
d. If Major GC after , Not enough memory , Report on OOM 了
( 3、 ... and ) Collect the whole pile (Full GC) Trigger mechanism :
a. call System.gc() when , System recommendation implementation Full GC, But not necessarily .
b. There is not enough space in the old age .
c. Insufficient method space .
d. adopt Minor GC The average size of the younger generation is larger than the available memory of the older generation .
e. from Eden District ,survivor space0(From Space) District direction survivor space1(To Space) When copying , Object greater than To Space Available memory , Then the object is transferred to the old generation , And the available memory of the old age is smaller than the size of the object .
explain :Full GC It's something to avoid in development or tuning , So the pause time will be shorter .
边栏推荐
- Fully Automated Gross Tumor Volume Delineation From PET in Head and Neck Cancer Using Deep Learning
- leetcode MYSQL数据库题目177
- Install and configure redis in the Linux environment, and set the boot auto start
- Custom MVC framework implementation
- Listview of the basic component of the shutter
- 图片验证码控件
- linux环境下安装配置redis,并设置开机自启动
- The collapsing "2.3 * 10 = 22" produced by multiplying float and int
- leetcode MYSQL数据库题目181
- A 2.5D Cancer Segmentation for MRI Images Based on U-Net
猜你喜欢

CROSSFORMER: A VERSATILE VISION TRANSFORMER BASED ON CROSS-SCALE ATTENTION

Automatic 3D Detection and Segmentation of Head and Neck Cancer from MRI Data.

Container of the basic component of the flutter

RecyclerView 通用适配器封装

1424. diagonal traversal II

C语言实现一种创建易管理易维护线程的方法

Alternative implementation of Scrollview pull-down header amplification

Fully Automated Delineation of Gross Tumor Volume for Head and Neck Cancer on PET-CT Using Deep Lear

Gmail:如何快速将邮件全部已读

Student addition / deletion gaih
随机推荐
setInterval、setTimeout和requestAnimationFrame
KDevelop new project
Monitoring data source connection pool usage
F5 BIG-IP iControl REST命令执行(CVE-2022-1388)
RecyclerView刷新闪烁与删除Item时崩溃问题
IPC(进程间通信)之管道详解
IDEA调试失败,报JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_LOAD(196)
In XML layout, the button is always displayed on the top layer
After installing anaconda, you need to enter a password to start jupyterlab
Cisco ASA、FTD和HyperFlex HX的漏洞分析复现
RecyclerView 粘性(悬浮)头部
力扣85题最大矩形
Please use the learned knowledge to write a program to find out the password hidden in the long string below. The burial point of the password conforms to the following rules:
JS obtain mobile phone model and system version
Gross Tumor Volume Segmentation for Head and Neck Cancer Radiotherapy using Deep Dense Multi-modalit
JVM之 MinorGC、 MajorGC、 FullGC、
图片验证码控件
JVM之虚拟机栈之动态链接
Es error nonodeavailableexception[none of the configured nodes are available:[.127.0.0.1}{127.0.0.1:9300]
leetcode MYSQL数据库题目180