The default GC for mono 3 is sgen.

Source: Internet
Author: User

Mono 3 now uses the sgen Garbage Collector by default, which improves the performance and scalability of the garbage collector to better utilize the multi-core processor hardware. Sgen has been transplanted to Windows and MIPS.

Mono is initially using Boehm-Demers-Wiser conservative garbage collector, which is also used as the default Garbage Collector in versions earlier than mono 3.0, the main problem with the Boehm garbage collector is that it cannot accurately read registers and stack frames. Because it cannot determine whether the given value is a pointer or a scalar, it always assumes that the given value is a pointer and marks the associated object as a surviving state. This will not only lead to misallocation of large memory blocks, but also make it difficult to compress the available space.

Later, Mono had its own simple generational GC, Which is sgen. Document address: http://www.mono-project.com/compacting_gc. use a precise generational garbage collector, similar to the. NET version of CLR. The sgen Garbage Collector uses two generations instead of three of. net, but uses an independent heap for large objects like. net.

    1. It can be divided into two generations. Previously, the description of its document was visible using conservative GC. Is a relatively backward implementation, without division,. Net CLR is three generations
    2. Special processing of large objects. By default, larger than 64 KB is used as large objects. Net large objects are larger than 20 KB and allocated to a special large object heap. Objects in the heap can be finalized and released like other small objects.
    3. Small objects use get_internal_mem/free_internal_mem for memory allocation, and large objects use OS malloc/free
    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:
    • ProgramDuring 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

Mono 3.0 added asynchronous support, improved sgen garbage collector, and other features

Build cross-platform applications with xwt

New mono GC

Sgen-concurrent mark

Sgen-concurrency and evacuation

Flame graphs for Instruments

How sgen rocks

Sgen-the write barrier

Sgen and dtrace

Sgen-finalization and weak references

Sgen-the major collectors

Sgen

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.