Garbage collection GC and garbage collection gc

Source: Internet
Author: User

Garbage collection GC and garbage collection gc
Objects recycled by the garbage collector: The Garbage Collector only recycles the memory in the managed heap. What kind of objects will be recycled? No variable reference object. Objects without variable reference can be recycled (null. When can it be recycled? Not sure. When the program needs new memory, it starts to recycle it. GC. Collect (); // manually call the garbage collector. We do not recommend that you use this function. During garbage collection, it will be paused (for a short time) for the program to automatically perform GC. Garbage collection-for the first garbage collection of three generations, GC will increase the memory of three generations if there is no memory to be recycled. when the memory is insufficient, an exception is thrown .. the mark-and-compact mechanism in. net (mark and compression). It is assumed that all objects are junk at the beginning. Find all objects, check whether they are spam, mark them as non-spam objects, and use Dispose () to spam other resources ()

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.