Simple comparison of seven garbage collectors common to the JVM

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 tag grooming 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, each time according to the allowable collection times, Priority to reclaim the most rubbish area (garbage first).

original link: http://blog.csdn.net/lingzhm/article/details/47174391 

Simple comparison of seven garbage collectors common to the JVM

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.