当前位置:网站首页>Yyds dry inventory brief chrome V8 engine garbage collection
Yyds dry inventory brief chrome V8 engine garbage collection
2022-06-27 16:12:00 【51CTO】
V8 It is a more mainstream at present JavaScript Execution engine , Using just in time compilation , It's very fast .V8 Your memory is limited , such as 64 The upper limit of bit operating system is 1.4T, The lower limit is 700M,32 The upper and lower limits of the bit operating system are 64M and 32M.
V8 Adopt the garbage collection strategy of generational recycling , Memory is divided into new generation and old generation , Different corresponding algorithms are used for different objects .
Above, V8 Memory allocation diagram of , You can see V8 Memory space is divided into two parts . Sinister from and to It's the new generation , It takes up less space (32M|16M), The Cenozoic here refers to the storage area with short survival time . The red part on the right is the older generation storage area with longer survival time .
V8 frequently-used GC The algorithm has the following 5 Kind of :
- Generational recycling
- Space replication
- Mark clear
- Tag to sort out
- Mark increment
Among them, the new generation adopts replication algorithm and label sorting for garbage collection , Older generations use markers to clear 、 Mark up and incremental mark up for garbage collection .
V8 New generation object recycling implementation
The picture above shows V8 Implementation diagram of new generation object recycling , The combination of replication algorithm and tag sorting is used for garbage collection . Two equal spaces of the Cenozoic memory area ,From Represents the space used to store active objects ,To Represents free space .V8 The new generation of object recycling is to copy the objects to... After finishing the sorting through marking To, And then To and From Space exchange , And free up the space occupied by the sorted useless objects . It should be noted that , Copying grooming objects to To There may be a promotion . Promotion refers to moving new generation objects to older generation storage . There are usually two conditions for promotion , One is a round of GC The new generation of objects who are still alive can be promoted , The second is To The utilization rate of space exceeds 25%.
V8 Old generation object recycling implementation
V8 The recycling process of the old generation adopts mark removal 、 The combination of mark sorting and mark increment . Generally, when garbage collection is carried out, the garbage space will be recycled through mark removal , But when the new generation moves to the old generation , And when the older generation doesn't have enough memory , Then the space will be optimized through tag sorting , And use incremental markers to optimize efficiency .
Mark increment is actually a method of marking the mark operation , Make the schedule reasonable . This sentence may be a little windy , Simply put, in garbage collection , Let the marking system distinguish different time periods when marking , Mark and execute respectively , Let the two operations be separated , To optimize the timing , This will make the page feel smoother .
边栏推荐
- Design of UART controller based on FPGA (with code)
- Hung - Mung! HDD Hangzhou station · salon hors ligne vous invite à construire l'écologie
- 洛谷入门1【顺序结构】题单题解
- ICML 2022 ぷ the latest fedformer of the Dharma Institute of Afghanistan ⻓ surpasses SOTA in the whole process of time series prediction
- SQL parsing practice of Pisa proxy
- 米哈游起诉五矿信托,后者曾被曝产品暴雷
- 字节跳动埋点数据流建设与治理实践
- 利用Redis实现订单30分钟自动取消
- 面试半年,上个月成功拿到阿里P7offer,全靠我啃烂了这份2020最新面试题!
- 特殊函数计算器
猜你喜欢

面试半年,上个月成功拿到阿里P7offer,全靠我啃烂了这份2020最新面试题!

Open source 23 things shardingsphere and database mesh have to say
锚文本大量丢失的问题

SIGKDD22|图“预训练、提示、微调”范式下的图神经网络泛化框架

树莓派初步使用

Slow bear market, bit Store provides stable stacking products to help you cross the bull and bear
The role of the symbol @ in MySQL

Bit. Store: long bear market, stable stacking products may become the main theme

3.2 multiple condition judgment

Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing
随机推荐
QT audio playback upgrade (7)
如果想用dms来处理数据库权限问题,想问下账号只能用阿里云的ram账号吗(阿里云的rds)
Distributed session solution
开源二三事|ShardingSphere 与 Database Mesh 之间不得不说的那些事
PSS: vous n'êtes qu'à deux niveaux du NMS Free + Lifting point | 2021 Paper
If you want to use DMS to handle database permissions, can you only use Alibaba cloud ram accounts (Alibaba cloud RDS)
FPGA based analog I ² C protocol system design (with main code)
泰山OFFICE技术讲座:第一难点是竖向定位
SQL injection principle
3.2 multiple condition judgment
What is the open source compatibility of the current version of polardb-x? mysql8?
Markdown syntax
带你认识图数据库性能和场景测试利器LDBC SNB
Practice of constructing ten billion relationship knowledge map based on Nebula graph
米哈游起诉五矿信托,后者曾被曝产品暴雷
Cesium 使用MediaStreamRecorder 或者MediaRecorder录屏并下载视频,以及开启摄像头录像。【转】
The array of C language is a parameter to pass a pointer
Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing
Luogu_ P1003 [noip2011 improvement group] carpet laying_ Violence enumeration
Beginner level Luogu 2 [branch structure] problem list solution