Garbage collection mechanism for Java programs

Source: Internet
Author: User

Show Recycling garbage analysis?

the traditional c,c++ language requires the programmer to reclaim the allocated memory.

This is done by programmers, which can cause problems, because programmers do not always know when memory should be released, and if some of the allocated memory is not recovered in a timely manner, it can cause the system to slow down, or even program paralysis, which is called a memory leak.

Cons: 1) The program forgets to reclaim useless memory in time, which causes memory leak and reduces system performance.

2) The program incorrectly reclaims memory from the system's core class library , causing the system to crash.

The memory allocations for Java programs are performed automatically by the Java Runtime Environment JRE in the background. The JRE is responsible for reclaiming memory that is no longer used, a mechanism known as the garbage collection mechanism. Programmers cannot precisely control the time and order of garbage collection. The general JRE provides a background thread for detection and control, both when the CPU is idle or when the memory is low.



Garbage collection mechanism for Java programs

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.