当前位置:网站首页>⼀个对象从加载到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)
边栏推荐
猜你喜欢

The longest ascending subsequence model acwing 1014 Mountaineering

AWS learning notes (III)

STM32CubeMX,68套组件,遵循10条开源协议

GAN发明者Ian Goodfellow正式加入DeepMind,任Research Scientist

"July 2022" Wukong editor update record

Data connection mode in low code platform (Part 2)

「2022年7月」WuKong编辑器更版记录
![GVIM [III] [u vimrc configuration]](/img/82/38355d7914e5fe490546347e57e35d.png)
GVIM [III] [u vimrc configuration]

Because the employee set the password to "123456", amd stolen 450gb data?

Substance painter notes: settings for multi display and multi-resolution displays
随机推荐
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
Es log error appreciation -maximum shards open
Mmkv use and principle
Bashrc and profile
Introduction and use of Kitti dataset
A laravel background management expansion package you can't miss - Voyager
First choice for stock account opening, lowest Commission for stock trading account opening, is online account opening safe
Million data document access of course design
Huawei cloud database DDS products are deeply enabled
Pytorch model trains practical skills and breaks through the bottleneck of speed
PD virtual machine tutorial: how to set the available shortcut keys in the parallelsdesktop virtual machine?
WPF DataGrid realizes the UI interface to respond to a data change in a single line
oracle 非自动提交解决
Full details of efficientnet model
Ascend 910实现Tensorflow1.15实现LeNet网络的minist手写数字识别
Substance painter notes: settings for multi display and multi-resolution displays
Instructions d'utilisation de la trousse de développement du module d'acquisition d'accord du testeur mictr01
在软件工程领域,搞科研的这十年!
ES日志报错赏析-trying to create too many buckets
Verilog implementation of a simple legv8 processor [4] [explanation of basic knowledge and module design of single cycle implementation]