Java garbage collection that matter (b) how many GC__JVM

Source: Internet
Author: User
Tags garbage collection

The types of GC collections in Java are mainly of several useserialgc,useconcmarksweepgc,useparnewgc,useparallelgc,useparalleloldgc,useg1gc, And how these parameters match, in fact, just look at the following code is very clear

bool arguments::check_gc_consistency () {bool status = TRUE; Ensure that's user has not selected conflicting sets//of collectors.
  [Note:this check is merely a user convenience; Collectors over-ride each other so, a non-conflicting//set is selected; However what the user gets isn't what they/may have expected to the combination they for.
  It ' s//better to reduce user confusion from not allowing them to//select conflicting combinations.
  UINT i = 0;
  if (USESERIALGC) i++; if (USECONCMARKSWEEPGC | |
  USEPARNEWGC) i++; if (USEPARALLELGC | |
  USEPARALLELOLDGC) i++;
  if (USEG1GC) i++; if (i > 1) {jio_fprintf (Defaultstream::error_stream (), "Conflicting collector combinations in Opti On List;
    "" Please refer to the release notes for the "combinations" "allowed\n");
  Status = FALSE;
} return status; }

We divide the GC into 4 different types.

1. SERIALGC

parameter-XX:+USESERIALGC

Young and old are all using the serial garbage collection algorithm, 2. PARALLELGC

parameter-XX:+USEPARALLELGC

Young area: Using parallel scavenge recovery algorithm

Old zone: A single-threaded or parallel garbage collection algorithm can be used, controlled by the-XX:+USEPARALLELOLDGC 3. CMS

parameter-XX:+USECONCMARKSWEEPGC

Young area: You can use a common or parallel garbage collection algorithm, controlled by parameter-XX:+USEPARNEWGC

Old zone: Only concurrent Mark Sweep 4 can be used . G1

Parameters:-XX:+USEG1GC

No Young/old area.

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.