Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8326092

Pause Remark sometimes has extremely long pause times on class unloading

    XMLWordPrintable

Details

    • gc

    Description

      ADDITIONAL SYSTEM INFORMATION :
      Running a containerized server application using eclipse-temurin:21.0.1_12-jdk on Google Kubernetes Engine, (16 core epyc-7003-series, 64 GB RAM).

      Flags:

      -XX:+AlwaysPreTouch -XX:ConcGCThreads=3 -XX:FlightRecorderOptions=stackdepth=256 -XX:G1ConcRefinementThreads=13 -XX:GCDrainStackTargetSize=64 -XX:InitialCodeCacheSize=272629760 -XX:InitialHeapSize=53951594496 -XX:InitialRAMPercentage=80.000000 -XX:MarkStackSize=4194304 -XX:MaxHeapFreeRatio=100 -XX:MaxHeapSize=53951594496 -XX:MaxRAM=67439493120 -XX:MaxRAMPercentage=80.000000 -XX:MinHeapSize=6815736 -XX:NewRatio=1 -XX:ObjectAlignmentInBytes=16 -XX:+PrintCommandLineFlags -XX:+PrintFlagsFinal -XX:ReservedCodeCacheSize=838860800 -XX:+SegmentedCodeCache -XX:+UseCompressedOops -XX:-UseContainerSupport -XX:+UseG1GC -XX:+UseTransparentHugePages


      A DESCRIPTION OF THE PROBLEM :
      Within 10 minutes of our application startup, we often encounter very long GC pause times in "Remark". These vary from 400ms to 4 seconds long.

      When capturing one such pause in the flight recorder, it shows that almost all of the pause is spent in "Class Unloading".

      This long pause tends to be repeated a few times but eventually settles when our application has been running for a while.

      As an experiment, I disabled class unloading with "-XX:-ClassUnloading". This completely solved the long pause times, but we instead saw much longer young generation pauses (went from around 160 ms -> 350 ms). The reason for that is not clear to us, but it was notable that "code root" scanning was very unbalanced.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      We run our server under moderate load and encounter the issue within 10 minutes. Unfortunately there is no small test case to reproduce the issue.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Class unloading should not be taking a few seconds.
      ACTUAL -
      Remark phase that is less than 100 ms?

      CUSTOMER SUBMITTED WORKAROUND :
      -XX:-ClassUnloading does prevent the long pause in "remark" but seems to have a side effect of causing longer pause times in young generation collection ("evacuate collection set").


      FREQUENCY : often


      Attachments

        1. gc_log.txt
          165 kB
        2. vminfo.txt
          311 kB

        Issue Links

          Activity

            People

              tschatzl Thomas Schatzl
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: