Let's talk about Erlang's garbage collection.

Source: Internet
Author: User

Original blog address, Http://www.linkedin.com/pulse/garbage-collection-erlang-tianpo-gao?trk=prof-post.

This article will simply describe the garbage collection of Erlang, which is not an in-depth discussion.

When performing a partial garbage collection, the garbage collector only recycles the younger generation and moves the old generation to the old-time dedicated heap. When an Erlang term undergoes 2 to 3 partial garbage collection, the term will be promoted to the old age. When a full amount of recycling is carried out, the garbage collector will recycle the young generation and the old age.

So how do we divide the memory objects into different generations? In the Erlang runtime environment, there is a field called High_water in the control block PCB of the Erlang process. When a term's address stored on the Erlang process heap is larger than the value stored in the High_water, then this term is the young generation, which is the old age.

A generational collector that pauses and replicates when memory is reclaimed in the Erlang runtime environment. Each time a garbage collection is made, a new heap is created, and when the garbage collection is complete, the original heap of the Erlang process is freed, and the new heap becomes the heap of the current Erlang process, and the surviving data in the original heap is moved to the new heap.


Let's talk about Erlang's garbage collection.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.