The advantages and principles of the garbage collection mechanism, and consider two recycling mechanisms

Source: Internet
Author: User

The advantages and principles of the garbage collection mechanism, and consider two recycling mechanisms

1, a notable feature of Java is the introduction of garbage collection mechanism, so that the C + + Programmer's most headache memory management problem solved, it makes the Java administrator in writing programs without the need to consider memory management , because of the garbage collection mechanism;

2. There is no longer a "scope" concept in Java objects, only references to objects are scoped.

3, garbage collection mechanism can effectively prevent memory leaks , effective use of memory can be used.

4. The garbage collector is usually run as a separate low-level thread , and in unpredictable cases the dead or unused objects in the storage heap are purged and recycled, and the programmer cannot call the garbage collector in real time

Garbage collection of an object or all objects.

5, recovery mechanism has generational replication garbage collection and tag garbage collection , incremental garbage collection .

The advantages and principles of the garbage collection mechanism, and consider two recycling mechanisms

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.