In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail the example analysis of the new generation of garbage collection knowledge points in js. Xiaobian thinks it is quite practical, so share it with you as a reference. I hope you can gain something after reading this article.
A new generation garbage collection algorithm is performed before the old generation mark-up collection.
Cenozoic and Old Cenozoic
The so-called Cenozoic refers to the newly generated objects; the old generation refers to the objects that have survived the Cenozoic garbage collection.
Scavenge GC: A New Generation Garbage Collection Algorithm
The algorithm is simple:
1. We maintain a list that records each time an older generation object points to a newborn object, and deletes the record each time a pointer is deleted. (This way we know which of the Cenozoic objects are alive.)
2. We divide the memory of the new generation objects into two equal spaces, From and To.
3. Every time a new object is born, it will appear in the From space.
4. Once the From space is full, Scavenge GC is triggered.
5. According to the list maintained, we take the surviving objects from the From space and copy them to the To space.
6. Empty the From space (so that inactive objects can be recycled)
7. From To Space Role Swap, Start Next Cycle
Among them, the objects that have experienced recycling and still survive, age++, will be promoted to the old generation by default in Java, age 15 specified by JS, the blogger has not yet identified
There is also a case where when copying to the To space, the To space has been used up by 25%, then this object is directly promoted to the senior area.
About "js in the new generation garbage collection knowledge point example analysis" This article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it to let more people see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.