当前位置:网站首页>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 .
边栏推荐
- Use redis to automatically cancel orders within 30 minutes
- QT audio playback upgrade (7)
- Distributed session solution
- NFT dual currency pledge liquidity mining DAPP contract customization
- Design of vga/lcd display controller based on FPGA (with code)
- What are the password requirements for waiting insurance 2.0? What are the legal bases?
- Design of FIR digital filter
- What is the open source compatibility of the current version of polardb-x? mysql8?
- Mobile terminal click penetration
- PSS:你距離NMS-free+提點只有兩個卷積層 | 2021論文
猜你喜欢

3.3 one of the fixed number of cycles

郎酒两大王牌产品成都联动共振,持续带动光瓶酒消费浪潮

Sigkdd22 | graph generalization framework of graph neural network under the paradigm of "pre training, prompting and fine tuning"

LeetCode每日一练(杨辉三角)

PSS:你距離NMS-free+提點只有兩個卷積層 | 2021論文
![[pyGame games] this](/img/3c/e573106ec91441a554cba18d5b2253.png)
[pyGame games] this "eat everything" game is really wonderful? Eat them all? (with source code for free)

Slow bear market, bit Store provides stable stacking products to help you cross the bull and bear

域名绑定动态IP最佳实践

保留有效位数;保留小数点后n位;

Yyds dry inventory solution sword finger offer: a path with a certain value in the binary tree (3)
随机推荐
E modulenotfounderror: no module named 'psychopg2' (resolved)
带你认识图数据库性能和场景测试利器LDBC SNB
What should the ultimate LAN transmission experience be like
Can polardb-x be accessed through the client of related tools as long as the client supporting JDBC / ODBC protocol is afraid?
Expert: those who let you go to a good school with a low score are all Scams
PSS:你距離NMS-free+提點只有兩個卷積層 | 2021論文
3.2 multiple condition judgment
The interview lasted for half a year. Last month, I successfully got Alibaba p7offer. It was all because I chewed the latest interview questions in 2020!
Bit.Store:熊市漫漫,稳定Staking产品或成主旋律
锚文本大量丢失的问题
Eolink launched a support program for small and medium-sized enterprises and start-ups to empower enterprises!
About fast exponentiation
ICML 2022 ぷ the latest fedformer of the Dharma Institute of Afghanistan ⻓ surpasses SOTA in the whole process of time series prediction
LeetCode每日一练(主要元素)
带你认识图数据库性能和场景测试利器LDBC SNB
LeetCode每日一练(杨辉三角)
Numerical extension of 27es6
What is the level 3 password complexity of ISO? How often is it replaced?
Problems encountered in vs compilation
Sigkdd22 | graph generalization framework of graph neural network under the paradigm of "pre training, prompting and fine tuning"