当前位置:网站首页>Learn JVM garbage collection 02 - a brief introduction to the reference and recycling method area
Learn JVM garbage collection 02 - a brief introduction to the reference and recycling method area
2022-07-05 12:15:00 【The king of early rising】
Catalog
quote
In the early JDK in , It's probably described like this :
If reference The value stored in the data of type represents the starting address of another block of memory , That's right reference Data represents a block of memory 、 A reference to an object .
This definition is very correct , But not enough . In actual operation, there is such a situation .
such as : An object is to be deleted , But I have enough memory , A little reluctant to , What if it works , Want to keep him . It's not too late to delete when the memory is insufficient .
—— Many of the system's cache functions are in line with such application scenarios .
So ah , four “ tart ” What was born !!
Strong citation
It refers to the reference assignment that is common in program code ,
It's like Student a = new Student(); This quoting relationship .
As long as I strongly quote in , No garbage collection can help you .
Soft citation
Refers to useful , But not necessarily .
Only objects associated with soft references , In system will happen out of memory Before the exception , These objects will be listed in the recycling scope for a second recycling , If there is not enough memory for this recycle , An out-of-memory exception is thrown .
Weak reference
It is also an unnecessary object to describe . But it will be taken away by garbage collection , No matter whether the memory is enough .
Virtual reference
Also known as “ Ghost quotes ” perhaps “ Phantom reference ”.
This relationship is very nihilistic , It has no effect on the lifetime of the object 、 You can't get object instances through virtual references .
The only purpose is , You can receive a system notification when the object is recycled .
To put it bluntly , That is, when an object is taken away, there can be a movement .
Recovery method area
About the concept of method area , If you don't know, you can see the last link .
According to the concept of method area , Recycling what is stored inside is not profitable . In fact, it's the same .
《Java Virtual machine specification 》 As mentioned in, you don't need virtual machines to implement garbage collection in the method area . Some garbage collectors do not have this part of the design .
Garbage in the method area is mainly discarded constants and types that are no longer used .
This part , That's all .
Keep early hours , take care . The king of early rising wishes you good luck !
边栏推荐
- Two minutes will take you to quickly master the project structure, resources, dependencies and localization of flutter
- 【ijkplayer】when i compile file “compile-ffmpeg.sh“ ,it show error “No such file or directory“.
- MySQL function
- ACID事务理论
- 强化学习-学习笔记3 | 策略学习
- 16 channel water lamp experiment based on Proteus (assembly language)
- Principle of persistence mechanism of redis
- Acid transaction theory
- 2022年国内云管平台厂商哪家好?为什么?
- 什么是数字化存在?数字化转型要先从数字化存在开始
猜你喜欢
The evolution of mobile cross platform technology
无线WIFI学习型8路发射遥控模块
Redis cluster (master-slave) brain crack and solution
[pytorch modifies the pre training model: there is little difference between the measured loading pre training model and the random initialization of the model]
[mainstream nivida graphics card deep learning / reinforcement learning /ai computing power summary]
查看rancher中debug端口信息,并做IDEA Remote Jvm Debug
MySQL transaction
Redis master-slave mode
自动化测试生命周期
Get data from the database when using JMeter for database assertion
随机推荐
[loss functions of L1, L2 and smooth L1]
7月华清学习-1
Matlab superpixels function (2D super pixel over segmentation of image)
多表操作-自关联查询
The evolution of mobile cross platform technology
Splunk configuration 163 mailbox alarm
Hash tag usage in redis cluster
[upsampling method opencv interpolation]
[cloud native | kubernetes] actual battle of ingress case (13)
Codeworks 5 questions per day (1700 average) - day 5
mmclassification 训练自定义数据
强化学习-学习笔记3 | 策略学习
MySQL regular expression
【ijkplayer】when i compile file “compile-ffmpeg.sh“ ,it show error “No such file or directory“.
手机 CPU 架构类型了解
【ijkplayer】when i compile file “compile-ffmpeg.sh“ ,it show error “No such file or directory“.
你做自动化测试为什么总是失败?
Video networkState 属性
1 plug-in to handle advertisements in web pages
Intern position selection and simplified career development planning in Internet companies