JVM memory management ------ GC Overview

Source: Internet
Author: User

1. objects that can be recycled.

2. When to recycle these objects.

3. What kind of recovery is used.

GC policy Algorithm

Reference Counting Algorithm. However, this algorithm has a fatal defect, that is, it cannot recycle referenced objects in a loop. Imagine that if JVM adopts this GC policy, the following code should not be expected to appear again when the program is compiled.

 =   =  Thread( = =  Object();                objectA.field == objectA;                objectA = = ; (

Root Search Algorithm. The processing method is,A number of root objects are set up. When a root object fails to reach a certain object, the object can be recycled..

1. The referenced object in the VM stack.

2. Objects referenced by class static attributes in the method area.

3. Objects referenced by constants in the method area.

4. Objects referenced by JNI in the local method stack.

 

Mark-clear algorithm, copy algorithm, and Mark-Sort Algorithm.

 

 

 

 

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.