Sgen of Mono

Source: Internet
Author: User

Mono is initially using Boehm-Demers-Wiser conservative garbage collector, which is also the default garbage collector.


Later, Mono had its own simple generational GC, Which is sgen. According to some test results in the mail list, the time efficiency of this sgen is very close to that of Boehm, and the memory is better.

Document address:,Note::Sgen has been developing, and its content may be different from the present.


I have read it and summarized it as follows:

  1. Divided into two generations
  2. Special processing of large objects. The default value is larger than 64 KB.
  3. Small objects use get_internal_mem/free_internal_mem for memory allocation. large objects use malloc/free of OS.
  4. Mark/sweep is used for major collection.
  5. The collection process is "Stop the world"
  6. Conservative scanning object
  7. The old generation points to the new generation only in the following two cases, so they are tracked:
  • During program execution, a field is assigned a value.
  • In the process of copying (on behalf of mobile), this object points to a new generation of Objects


Http:// (computer_science)

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: 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.