Increased CPU time with G1GC

Prasanth Mathialagan prasanthmathialagan at gmail.com
Fri Jun 5 16:44:14 UTC 2020


Hi,
We recently switched our Java application from CMS to G1. Since then we
observed increased CPU time (user cpu) and latency for the requests.

*Observations*

   - Count of GC pauses remains the same with CMS and G1 and so does the
   pause time.
   - My initial suspicion was that the application threads were competing
   with GC threads to get CPU cycles. But I don't see any indication of
   increased concurrent time in GC logs.

I suspect that the overhead associated with read/write barriers could be
the reason for the increased CPU cycles but I want to confirm that. *Are
there any GC flags that prints statistics about read/write barriers? Or is
there a way to debug this?*

java -version

openjdk version "1.8.0_222"

OpenJDK Runtime Environment Corretto-8.222.10.1 (build 1.8.0_222-b10)

OpenJDK 64-Bit Server VM Corretto-8.222.10.1 (build 25.222-b10, mixed mode)

These are the command line flags I find in GC logs that the application
uses.
-XX:+UseG1GC
-XX:CICompilerCount=3
-XX:CompressedClassSpaceSize=931135488
-XX:ConcGCThreads=1
-XX:G1HeapRegionSize=4194304
-XX:InitialCodeCacheSize=402653184
-XX:InitialHeapSize=8589934592
-XX:InitialTenuringThreshold=6
-XX:InitiatingHeapOccupancyPercent=50
-XX:MarkStackSize=4194304
-XX:MaxGCPauseMillis=200
-XX:MaxHeapSize=8589934592
-XX:MaxMetaspaceSize=939524096
-XX:MaxNewSize=5150605312
-XX:MaxTenuringThreshold=6
-XX:MetaspaceSize=268435456
-XX:MinHeapDeltaBytes=4194304
-XX:+ParallelRefProcEnabled
-XX:+PrintAdaptiveSizePolicy
-XX:+PrintClassHistogram
-XX:+PrintGC
-XX:+PrintGCApplicationStoppedTime
-XX:+PrintGCDateStamps
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-XX:+PrintSafepointStatistics
-XX:PrintSafepointStatisticsCount=1
-XX:PrintSafepointStatisticsTimeout=1000
-XX:+PrintTenuringDistribution
-XX:ReservedCodeCacheSize=402653184
-XX:+ScavengeBeforeFullGC
-XX:SoftRefLRUPolicyMSPerMB=2048
-XX:StackShadowPages=20
-XX:ThreadStackSize=512
-XX:+TieredCompilation
-XX:+UseBiasedLocking
-XX:+UseCompressedClassPointers
-XX:+UseCompressedOops
-XX:+UseFastAccessorMethods
-XX:+UseLargePages
-XX:+UseTLAB

Let me know if I need to provide any other information.

Regards,
Prasanth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20200605/ee8a6d78/attachment.htm>


More information about the hotspot-gc-use mailing list