Java basic knowledge Summary of garbage collection mechanism

Source: Internet
Author: User

Garbage collection mechanism

The Java death garbage collection mechanism is one of the important functions of the Java language. When a program creates objects, arrays, and other reference type objects, the system automatically allocates a chunk of memory in the memory area, where the object is stored in the memory area, and when the memory is no longer referenced by any variables, the memory becomes garbage and waits for the garbage collection mechanism to be recycled.

Characteristics of garbage collection mechanism

1. The garbage collection mechanism is only responsible for reclaiming objects in heap memory and does not reclaim any physical resources (such as database connections, network connections, IO streams, and so on).

2. The program does not accurately control the operation of garbage collection, garbage collection will be appropriate when the time. When the object loses its reference permanently, the system will recycle the tower at the appropriate time.

Java basic knowledge Summary of garbage collection mechanism

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.