Java garbage collector and memory allocation policy

Source: Internet
Author: User

The counter of the program, the virtual machine stack, the local method stack 3 regions are born with threads, and the stack in the stack executes the stack and stack operations methodically as the method enters and exits.

The method of judging if the object is dead:

First, the reference counting algorithm:

Add a reference counter to the object, and whenever there is a place to reference it, the counter value is incremented by 1, and when the reference fails, the counter value is reduced by 1, and the object with counter 0 at any time is not possible to be used again.

Two, the Accessibility analysis algorithm:

The basic idea is to use a series of objects called "GC Roots" as the starting point, starting from these nodes to search down, the path that the search traversed is called the reference chain (Reference Chain), when an object to the GC Roots no reference chain connected, it proves that this object is not available.

Cond...

Java garbage collector and memory allocation policy

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.