当前位置:网站首页>TLAB mechanism of JVM object memory allocation and TLAB process in G1
TLAB mechanism of JVM object memory allocation and TLAB process in G1
2022-06-25 09:10:00 【Happy Planet】
List of articles
One : Review the life cycle of an object
1.1 Object lifecycle flowchart

1.2 Focus on
Object's finalize() Methods are called only once , That is to say, an object can only have one resurrection opportunity , But the resurrection of an object will destroy the life cycle of the object , Interfere with the JVM Collection of objects , So in finalize() Methods are generally used to release resources before collection of write objects .
Two : TLAB( Memory allocation buffer )
From the life cycle of the object in the above figure , We have learned that the memory allocation and initialization of an object must be performed before it is used , Next, we describe two strategies for object memory allocation
2.1 Why would there be TLAB
We know that object memory allocation was initially considered in the new generation Eden Area allocates memory for objects , But a heap is an area shared by threads , In a multithreaded environment, it is common for multiple threads to manipulate the same block of memory at the same time , To ensure the security of data during object allocation , We need to use global locks to solve the problem of multiple threads accessing the same block of memory at the same time , But global locking reduces efficiency and program throughput , To solve this problem TLAB emerge as the times require .
2.2 TLAB
TLAB Yes Eden The memory of the area is divided , Carve out a small area , This area is called the object memory allocation buffer , It allocates a space for each thread .
advantage :
- Use TLAB It can avoid a series of thread safety problems .
- It improves the efficiency and throughput of the program .
This kind of use TLAB The strategy for memory allocation is called Fast allocation strategy .
3、 ... and :G1 In the source TLAB Strategy
3.1 brief introduction
When allocating space , In order to improve the JVM Operating efficiency , The critical area should be minimized , Avoid global locks .G1 In the common application scenarios of , There will be a large number of accessors executing at the same time , To reduce lock conflicts ,JVM Introduced TLAB( Thread local allocation buffer Thread Local Allocation Buffer) Mechanism .
3.2 flow chart
According to the source code, the following flow chart can be obtained :
If it helps you , Don't forget to like your collection !
边栏推荐
- 二、训练fashion_mnist数据集
- 十大券商开户风险大吗,安全靠谱吗?
- ¥3000 | 录「TBtools」视频,交个朋友&拿现金奖!
- 【MYSQL】索引的理解和使用
- [MySQL] understanding of transactions
- 【MYSQL】事务的理解
- 【无标题】**数据库课设:三天完成学生信息管理系统**
- Specific usage of sklearn polynomialfeatures
- Analysis on the bottom calling process of micro service calling component ribbon
- Atguigu---01-scaffold
猜你喜欢

Unity--configurable joint -- a simple tutorial to get you started with configurable joints

Nodejs using the express framework demo

C#程序终止问题CLR20R3解决方法

声纹技术(六):声纹技术的其他应用

【OpenCV】—离散傅里叶变换

Matplotlib axvline() and axhline() functions in Matplotlib

jmeter中csv参数化

matplotlib matplotlib中决策边界绘制函数plot_decision_boundary和plt.contourf函数详解

获取扫码的客户端是微信还是支付宝

Specific usage of sklearn polynomialfeatures
随机推荐
Nodejs using the express framework demo
三、自动终止训练
Notes on key vocabulary of the original English work biography of jobs (I) [introduction]
请问在手机上开户股票,还是去证券公司开户安全?
WebGL谷歌提示内存不够(RuntimeError:memory access out of bounds,火狐提示索引超出界限(RuntimeError:index out of bounds)
The meshgrid() function in numpy
手机办理长城证券开户靠谱安全吗?
【MYSQL】索引的理解和使用
Matplotlib axvline() and axhline() functions in Matplotlib
Where are the hotel enterprises that have been under pressure since the industry has warmed up in spring?
Cazy eight trigrams maze of Chang'an campaign
socket编程——epoll模型
《乔布斯传》英文原著重点词汇笔记(四)【 chapter two 】
Voiceprint Technology (IV): Engineering deployment of voiceprint recognition
Are the top ten securities companies at great risk of opening accounts and safe and reliable?
[MySQL] understanding of transactions
flutter 获取顶部状态栏的高度
How can games copied from other people's libraries be displayed in their own libraries
sklearn PolynomialFeatures的具体用法
Make a skylearn high-dimensional dataset_ Circles and make_ moons