当前位置:网站首页>⼀个对象从加载到JVM,再到被GC清除,都经历了什么过程?
⼀个对象从加载到JVM,再到被GC清除,都经历了什么过程?
2022-07-07 12:42:00 【51CTO】
- 对象申请空间
- 判断Eden区是否有可分配对象空间,如果Eden区可分配,则直接分配空间
- 空间不足则进行YGC,针对YGC后还存活的对象,YGC操作细节如下:
- 判断Survivor区是否可分配空间,可分配,则从from到to区(S0/S1来回切换),阈值 + 1
- Survivor区不可分配,则直接晋升为老年代
- 判断Survivor区对象阈值是否大于15,大于则晋升为老年代,否则从from到to区,阈值 + 1
- YGC后再判断Eden区是否有可分配对象空间,是则直接分配空间,否则判断老年区是否可分配空间
- 老年区可分配,则申请对象空间,不可分配则进行FGC
- 再判断老年区是否可分配,可分配,则申请对象空间,不可分配则报错OOM(Out Of Memory)
边栏推荐
- Attribute keywords serveronly, sqlcolumnnumber, sqlcomputecode, sqlcomputed
- Navigation — 这么好用的导航框架你确定不来看看?
- MicTR01 Tester 振弦采集模块开发套件使用说明
- OAuth 2.0 + JWT protect API security
- Mrs offline data analysis: process OBS data through Flink job
- Electronic remote error
- Simple use of websocket
- Leetcode——236. The nearest common ancestor of binary tree
- Source code analysis of ArrayList
- 《微信小程序-进阶篇》组件封装-Icon组件的实现(一)
猜你喜欢
OAuth 2.0 + JWT protect API security
[Reading stereo matching papers] [III] ints
「2022年7月」WuKong编辑器更版记录
比尔·盖茨晒48年前简历:“没你们的好看”
云上“视界” 创新无限 | 2022阿里云直播峰会正式上线
用例图
Mmkv use and principle
Pinduoduo lost the lawsuit, and the case of bargain price difference of 0.9% was sentenced; Wechat internal test, the same mobile phone number can register two account functions; 2022 fields Awards an
【愚公系列】2022年7月 Go教学课程 005-变量
GVIM [III] [u vimrc configuration]
随机推荐
The method of parsing PHP to jump out of the loop and the difference between continue, break and exit
C # use TCP protocol to establish connection
数据湖(九):Iceberg特点详述和数据类型
Electronic remote error
多商户商城系统功能拆解01讲-产品架构
全球首款 RISC-V 笔记本电脑开启预售,专为元宇宙而生!
Verilog implementation of a simple legv8 processor [4] [explanation of basic knowledge and module design of single cycle implementation]
PD虚拟机教程:如何在ParallelsDesktop虚拟机中设置可使用的快捷键?
Leetcode one question per day (636. exclusive time of functions)
"July 2022" Wukong editor update record
Leetcode——344. Reverse string /541 Invert string ii/151 Reverse the word / Sword finger in the string offer 58 - ii Rotate string left
PAG体验:十分钟完成AE动效部署上线各平台!
Cocos creator direction and angle conversion
NDK beginner's study (1)
JS image to Base64
Es log error appreciation -trying to create too many buckets
oracle 触发器实现级联更新
2022pagc Golden Sail award | rongyun won the "outstanding product technology service provider of the year"
Half an hour of hands-on practice of "live broadcast Lianmai construction", college students' resume of technical posts plus points get!
Beginner JSP