Garbage collector and memory allocation policies

Source: Internet
Author: User

In the various parts of the Java Memory Runtime area: Program counter, virtual machine stack, local method stack with line generates and off,

For the heap and method extents in Java, which objects will be created only while the program is running, this portion of memory allocation and recycling is dynamic, and the garbage collector focuses on this part of memory.

What memory needs to be recycled?

When do I recycle?

How to recycle?

The garbage collector needs to determine which objects are dead before the heap is recycled (objects that can no longer be used by any means)

The general approach is to add a reference counter to the object, that is, the reference counting algorithm to manage memory, but the JVM does not, because there is no way to resolve the problem of circular references between objects.

1: Accessibility analysis

Garbage collector and memory allocation policies

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.