One Scenario Of G1GC Vs CMS Via Load Tests - LinkedIn
Agree & Join LinkedIn
By clicking Continue to join or sign in, you agree to LinkedIn’s User Agreement, Privacy Policy, and Cookie Policy.
Sign in to view more content
Create your free account or sign in to continue your search
Sign inWelcome back
Email or phone Password Show Forgot password? Sign inor
By clicking Continue to join or sign in, you agree to LinkedIn’s User Agreement, Privacy Policy, and Cookie Policy.
New to LinkedIn? Join now
or
New to LinkedIn? Join now
By clicking Continue to join or sign in, you agree to LinkedIn’s User Agreement, Privacy Policy, and Cookie Policy.
LinkedIn is better on the app
Don’t have the app? Get it in the Microsoft Store.
Open the app Skip to main contentRecently worked on a New Use case and during the performance validation of the product we observed High CPU Utilization and GC activity.
This is a web based application and creates incident tickets. The system metrics were captured and JVisual VM snapshots were also captured.
Load Test 1:
We started using the below parameters set related to GC (ConcMarkSweeGC):
-Xmx6G -Xms6G -XX:+UseCompressedOops -XX:NewRatio=2 -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=512m -XX:+DisableExplicitGC -XX:+HeapDumpOnOutOfMemoryError -XX:+UseConcMarkSweepGC
Issue:
During the load tests we observed higher CPU Utilization trend, increase in Average Response times and high GC Activity.
The GC activity can be observed from the JVM snapshot as below:
To get more clear picture we have enabled GC logging (-Xlog:gc*,gc+phases=info:file=gc.log:time,pid,tags:filecount=10,filesize=20m) and repeated the load test.
The analysis of GC log (https://gceasy.io/) revealed the following:
Total Xmx set is 6GB, the young gen is at almost 2GB as indicated by NewRatio=2 (we have 6GB -XX:NewRatio=2 which means 2/3 of 6 GB = 4 GB for old generation and 1/3 of 6 GB = 2 GB for young generation).
The Key Performance Indicators are as below and ~46% of GC Pause Duration is in range of 400-500ms.
The GC log reveals that we have only Young GC occurrence and no old generation cycle observed during the test. CMS Collection phase statistics show below values.
Also, more than 99% of the time the reason for triggering GC is Allocation Failure.
Allocation Failure happens when there isn't enough free space to create new objects in Young generation. Allocation failures triggers Young GC.
Suggestions to resolve the issue with GC:
- We can stay with same GC choice (this case CMS); by adjusting NewRatio=1 so ½ for young and ½ for old. 1 is the smallest value you can put in for CMS.
- Better choice: G1GC may work better. Below values are recommended to be set for G1GC:
-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:+UseStringDeduplication -XX:MaxGCPauseMillis=200 -XX:G1NewSizePercent=40
Note : (remember to remove the options: -XX:+UseConcMarkSweepGC -XX:NewRatio=2 when changing from CMS to G1GC)
Load Test 2:
We started using the below parameters set related to G1GC as proposed:
-Xmx6G -Xms6G -XX:+UseCompressedOops -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=512m -XX:+DisableExplicitGC -XX:+HeapDumpOnOutOfMemoryError -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:+UseStringDeduplication -XX:MaxGCPauseMillis=200 -XX:G1NewSizePercent=40
The GC activity can be observed from the JVM snapshot as below:
The analysis of GC log for the above test is as below:
The Key Performance Indicators are as below and the GC Pause duration is in range of 200-300ms for ~52% GCs.
G1GC collection phase statistics are as below and are self-explanatory:
GC triggers are due to below causes. G1 Evacuation Pause – triggered when copying live objects from one set of regions to another set of regions.
G1 Humongous Allocation – These are allocations that are larger than 50% of the regions size in G1. Frequent humongous allocation may cause performance issues.
Also, we observe the total GC count has reduced to 75 from 194 as compared to CMS GC
Summary :
G1GC is clearly a better choice: lower GC pause time, lower Std Dev (more consistent time), lower CPU usage for GC (higher throughput).
Comparison table of both is as follows:
Note: The same might be achieved with CMS by setting the NewRatio=1 instead of 2. But we went ahead with G1GC as starting from JDK14 (Build 23+), the UseConcMarkSweepGC; support was removed in 14.0
The tests are not an exact comparison between CMS GC and G1GC, but we can reduce the GC activity significantly just by switching to G1GC.
Like Like Celebrate Support Love Insightful Funny Comment- Copy
- X
- Report this comment
An informative article..
Like Reply 1 Reaction 2 ReactionsTo view or add a comment, sign in
More articles by Lakshmi Narayan
- Enabling GC log files in JDK 11
Aug 21, 2020
Enabling GC log files in JDK 11
There are few changes in GC logging starting from Java9. Below are Unrecognized flags in OpenJDK 11 (checked) related…
- Steps to create an NFS Mount for pods
Dec 13, 2018
Steps to create an NFS Mount for pods
Steps to create an NFS Mount for pods Perform the below steps on NFS Server: In our case, the NFS is mounted on another…
- SS command to get socket statistics
Aug 30, 2018
SS command to get socket statistics
Today i want to share a command ss (Socket statistics) to investigate network and debug tcp connections. ss is used to…
- Initial basic checks before proceeding to DB tuning in MSSQL
May 16, 2018
Initial basic checks before proceeding to DB tuning in MSSQL
Initial basic checks before proceeding to DB tuning in MSSQL: Check your SQL Server environment before tuning for…
1 Comment
- Linux tuning to support more users in Jmeter Load Tests
Jul 25, 2017
Linux tuning to support more users in Jmeter Load Tests
While running our jmeter load tests on Unix box with a target of 2500 User Load we got the exception “Non HTTP response…
8 Comments
- COMMAND TO OBTAIN COMPLETE DETAILS OF A PROCESS RUNNING IN WINDOWS
Dec 26, 2016
COMMAND TO OBTAIN COMPLETE DETAILS OF A PROCESS RUNNING IN WINDOWS
Just wanted to share a command in Windows, to obtain complete details of the processes running in windows. In…
- TO OBTAIN GC DETAILS FOR RUNNING JAVA PROCESS WITHOUT ADDING THE PARAMETERS IN JVM ARGS
Dec 26, 2016
TO OBTAIN GC DETAILS FOR RUNNING JAVA PROCESS WITHOUT ADDING THE PARAMETERS IN JVM ARGS
Just wanted to share a tool for GC Monitoring. Note : This works perfectly in Linux and not on Windows OS.
4 Comments
- Database Test Plan with JMeter
Oct 7, 2015
Database Test Plan with JMeter
Let us see how we can test the database in Jmeter using JDBC Request Sampler. In this tutorial we will use oracle jdbc…
- Using a Custom Jar in BeanShell Sampler in Jmeter
Oct 7, 2015
Using a Custom Jar in BeanShell Sampler in Jmeter
Let us see an example on how we can use a custom Java classes and methods in JMeter BeanShell sampler. Outline of the…
4 Comments
- How to use a value between two different threads in Jmeter
Sep 29, 2015
How to use a value between two different threads in Jmeter
How to use a value between two different threads: Let us see how we can use the extracted value in one thread can be…
Others also viewed
-
Why the Kernel Is Always There — Even When It’s Not Running
Moon Hee Lee 8mo -
Ixia Open Traffic generator & DUT
Dipankar Shaw 2y -
Global Performance: It’s Caches All the Way Down
Tigris Data 9mo -
The Mistake of Watching CPU Alone
Samson Jaykumar 8mo -
PCIe Data link layer
Ajazul Haque 10mo -
Real-Time Isn’t Always Real: Lessons from a CPU Bottleneck
APSI Technologies 4mo -
Understanding Network Interface Cards: From Registers to Packets
David Zhu 7mo -
Comprehensive Guide to spidev Driver ioctl Commands: Beyond SPI_IOC_MESSAGE
David Zhu 8mo -
PCI Bus Stands for What? Basic and Extension
KUKE ELECTRONICS LIMITED 2y -
Optimizing JVM Performance: Reducing G1GC Max Pause Time from 50ms to 30ms
Prateek Jain 9mo
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
Từ khóa » G1 Gc Vs Cms
-
9 Garbage-First Garbage Collector
-
Garbage Collectors - Serial Vs. Parallel Vs. CMS Vs. G1 (and What's ...
-
Java - CMS Vs G1 Garbage Collector - Stack Overflow
-
ElasticSearch's Garbage Collector — CMS Or G1GC - Medium
-
How To Choose Garbage Collector For Your Application - Java - Site24x7
-
JVM Garbage Collectors - Baeldung
-
G1 Vs CMS Vs Parallel GC | Plumbr – User Experience & Application ...
-
G1 Vs CMS Vs Parallel GC - DZone Performance
-
G1 Vs CMS Comparison - TechPaste.Com
-
JVM: Why CMS Garbage Collector Deprecating - LinkedIn
-
Switching From CMS To G1GC - Cloudera Documentation
-
GCs Of JVM Tuning: PS+PO VS CMS VS G1 - Adrian's Blog
-
Best Practice For JVM Tuning With CMS GC - ForgeRock Backstage
-
Best Practice For JVM Tuning With G1 GC | ForgeRock Backstage