当前位置:网站首页>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 !
边栏推荐
- MVVM framework part I lifecycle
- Multi table operation - Auto Association query
- Image hyperspectral experiment: srcnn/fsrcnn
- Seven polymorphisms
- Video networkstate property
- MySQL function
- One article tells the latest and complete learning materials of flutter
- Deep discussion on the decoding of sent protocol
- Codeworks 5 questions per day (1700 average) - day 5
- 图像超分实验:SRCNN/FSRCNN
猜你喜欢
![[yolov5.yaml parsing]](/img/ae/934f69206190848ec3da10edbeb59a.png)
[yolov5.yaml parsing]
你做自动化测试为什么总是失败?

1 plug-in to handle advertisements in web pages
![[untitled]](/img/56/6a9a4bcab6503872942fff7a365def.jpg)
[untitled]
![[yolov3 loss function]](/img/79/87bcc408758403cf3993acc015381a.png)
[yolov3 loss function]
![[pytorch pre training model modification, addition and deletion of specific layers]](/img/cb/aa0b1116ec9b98e3ee5725aa58f4fe.png)
[pytorch pre training model modification, addition and deletion of specific layers]

Thoughts and suggestions on the construction of intelligent management and control system platform for safe production in petrochemical enterprises

Select drop-down box realizes three-level linkage of provinces and cities in China

mmclassification 训练自定义数据

The most comprehensive new database in the whole network, multidimensional table platform inventory note, flowus, airtable, seatable, Vig table Vika, flying Book Multidimensional table, heipayun, Zhix
随机推荐
Want to ask, how to choose a securities firm? Is it safe to open an account online?
Pytorch linear regression
Take you two minutes to quickly master the route and navigation of flutter
POJ-2499 Binary Tree
Get data from the database when using JMeter for database assertion
Matlab label2idx function (convert the label matrix into a cell array with linear index)
Pytorch weight decay and dropout
【pytorch 修改预训练模型:实测加载预训练模型与模型随机初始化差别不大】
信息服务器怎么恢复,服务器数据恢复怎么弄[通俗易懂]
byte2String、string2Byte
MySQL stored procedure
Splunk configuration 163 mailbox alarm
[yolov3 loss function]
Seven polymorphisms
【ijkplayer】when i compile file “compile-ffmpeg.sh“ ,it show error “No such file or directory“.
MySQL view
vscode快捷键
PXE startup configuration and principle
MySQL trigger
[singleshotmultiboxdetector (SSD, single step multi frame target detection)]