Java Virtual machine Seven garbage collector comparisons

Source: Internet
Author: User

1. The serial collector was once the only option for the new generation of virtual machines, a single-threaded collector that must stop the world when collecting garbage, which is the default Cenozoic collector that the virtual machine runs in client mode.

2, Serial old is the older version of the Serial collector, is also a single-threaded collector, using the tag collation algorithm.

3. The Parnew Collector is a multithreaded version of the serial collector , and many of the new generation collectors that run in virtual machines in server mode, except serial, can work with the CMS collector only.


4, Parallel scavenge collector is also a new generation of collectors, using the replication algorithm is a parallel multi-threaded collector, its goal is to achieve a controllable running user code with (running user code + garbage collection Time) percent value.

5. The Parallel old collector is an older version of the Parallel scavenge collector , using multi-threaded and tagging algorithms.


6. The Concurrent Mark Sweep Collector is a collector that targets the shortest recovery pause time, based on the tag-clearing algorithm.

The process is as follows: initial tag , concurrent tagging, re-tagging , concurrent purging, the advantage is concurrent collection, low pauses, the disadvantage is very sensitive to CPU resources, unable to handle floating garbage, the end of the collection will produce a lot of space debris .


7, G1 Collector is based on the implementation of the labeling algorithm, will not produce space debris , can precisely control the pause, the heap is divided into a number of fixed-size independent areas , and track the extent of these areas of garbage accumulation, in the background to maintain a priority list, Priority is given to recovering the most trash area (garbage first) per time, based on the allowable collection times.


Copyright NOTICE: This article is the original blogger article, reproduced please indicate the source: Http://blog.csdn.net/lingzhm

Java Virtual machine Seven garbage collector comparisons

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.