JavaVM judges when to recycle the Accessibility analysis algorithm used by the object instance, instead of referencing the counting algorithm, javavm instance

Source: Internet
Author: User

JavaVM judges when to recycle the Accessibility analysis algorithm used by the object instance, instead of referencing the counting algorithm, javavm instance

I have been developing java for several years. Today I know the java memory Reclaim Algorithm.

The Java Virtual Machine determines whether an object instance can be recycled, rather than referencing the counting algorithm.

Because the reference counting algorithm is difficult to solve the problem that objects directly reference each other cyclically.

Therefore, java C # uses accessibility analysis to determine whether objects can be recycled.

The basic idea of this algorithm is to use a series of objects called "GC Root" as the starting point. From these nodes, you can start to search for elements and find the paths that have passed is called the application chain, when an object is connected to GC Roots without any reference chain. It proves that this object is unavailable and can be recycled. Objects such as object5, object6, and object7 are related to each other, but they can be achieved without GC roots. So they can be recycled.

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.