Total WebSite Views Count

Garbage Collection Strategies In Java

GC Execution Strategies

The following JVM switch options will help you to choose a GC strategy at the JVM startup.
  • Serial GC [-XX:+UseSerialGC] — simple mark-sweep-compact approach with young and old gen garbage collections (a.k.a. Minor GC and Major GC). Suitable for simple stand alone client-machine applications running with low memory footprint and less CPU power.
  • Parallel GC [-XX:+UseParallelGC] — parallel version of mark-sweep-compact approach for Minor GC with multiple threads (Major GC still happens with a single thread in serial manner). –XX:ParallelGCThreads=n option is used to define the number of parallel threads that need to be spawned to run Minor GC (normally n=number of CPU cores)
  • Parallel Old GC [-XX:+UseParallelOldGC] — parallel version of mark-sweep-compact approach for both Minor and Major GCs.
  • Concurrent Mark Sweep (CMS) Collector [-XX:+UseConcMarkSweepGC] — Garbage collection normally happens with pauses (Major GC takes a long time), which makes it problematic for highly responsive applications where we can’t afford long pause times. CMS Collector minimizes the impact of these pauses by doing most of the garbage collection work (i.e. Major GC) concurrently within the application threads (Minor GC still follows the usual parallel algorithm without any concurrent progress with application threads). –XX:ParallelCMSThreads=n option can be used to define the number of parallel threads.
  • G1 Garbage Collector [-XX:+UseG1GC] — Garbage First (G1) Collector divides the Heap into multiple equal-sized regions and when GC is invoked, first collects the region with lesser live data (young gen and old gen implementations don’t apply here). This collector is a parallel, concurrent and incrementally compact low-pause garbage collector which intends to replace the CMS Collector.

AWS Services

AWS Services

Technology Selection & Evaluation Criteria

Technology Selection & Evaluation Criteria

Scale Cube - Scale In X Y Z Cube

Scale Cube - Scale In X Y Z Cube

Feature Post

AWS Services

About Me

About Me

Spring Cloud

Spring Cloud
Spring Cloud

Spring Cloud +mCloud Native + Big Data Archittect

Spring Cloud +mCloud Native + Big Data Archittect

ACID Transaction

ACID Transaction

Data Pipe Line Stack

Data Pipe Line Stack

Popular Posts