当前位置:网站首页>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 !
边栏推荐
- How can beginners learn flutter efficiently?
- Course design of compilation principle --- formula calculator (a simple calculator with interface developed based on QT)
- Deep discussion on the decoding of sent protocol
- Application of a class of identities (vandermond convolution and hypergeometric functions)
- byte2String、string2Byte
- Codeforces Round #804 (Div. 2)
- MySQL function
- Matlab boundarymask function (find the boundary of the divided area)
- Get all stock data of big a
- 想问问,如何选择券商?在线开户是很安全么?
猜你喜欢
[untitled]
Why learn harmonyos and how to get started quickly?
HiEngine:可媲美本地的云原生内存数据库引擎
[calculation of loss in yolov3]
Reinforcement learning - learning notes 3 | strategic learning
报错ModuleNotFoundError: No module named ‘cv2.aruco‘
A guide to threaded and asynchronous UI development in the "quick start fluent Development Series tutorials"
Two minutes will take you to quickly master the project structure, resources, dependencies and localization of flutter
Linux安装部署LAMP(Apache+MySQL+PHP)
Redirection of redis cluster
随机推荐
How to clear floating?
Wireless WiFi learning 8-channel transmitting remote control module
Thoughts and suggestions on the construction of intelligent management and control system platform for safe production in petrochemical enterprises
ABAP table lookup program
[loss functions of L1, L2 and smooth L1]
Understand kotlin from the perspective of an architect
Tabbar configuration at the bottom of wechat applet
信息服务器怎么恢复,服务器数据恢复怎么弄[通俗易懂]
codeforces每日5题(均1700)-第五天
Mongodb replica set
[cloud native | kubernetes] actual battle of ingress case (13)
Video networkstate property
Mmclassification training custom data
Open3d mesh (surface) coloring
Seven ways to achieve vertical centering
Hiengine: comparable to the local cloud native memory database engine
Principle of redis cluster mode
PXE startup configuration and principle
POJ-2499 Binary Tree
16 channel water lamp experiment based on Proteus (assembly language)