JVM garbage Collection algorithm (tag-purge, copy, tag-organize)

Source: Internet
Author: User

"JVM garbage Collection algorithm"

1) Mark - Clear algorithm:

Mark stage: First, mark all objects starting from the root node, and not tagged as garbage objects (wrong?). )

Purge stage: Clears all unmarked objects

2) copy algorithm:

Divide the original memory space into two pieces, one at a time, and at garbage collection, copy the surviving objects in the memory being used into the unused block of memory, and then clear all the objects in the memory block that you are using.

3) Labeling - sorting algorithm:

Mark Stage: Marks all objects from the root node that are not marked as garbage objects, first through the root node

Finishing phase: Compresses all the surviving objects into a section of memory, then cleans up all the space on the boundary

Comparison of three algorithms:

  Efficiency: copy > tag grooming > tag cleanup ( efficiency here is just a simple comparison of time complexity, not necessarily . )

  Memory Utilization: Tag Grooming > labeling cleanup > replication

  Memory Uniformity: copy = tag grooming > Mark Erase

JVM garbage Collection algorithm (tag-purge, copy, tag-organize)

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.