1

I am running application in java17 on kubernetes with rollingUpdate deployment.

The JVM properties are as follows:

        - name: InitialRAMPercentage
          value: '-XX:InitialRAMPercentage=40'
        - name: MaxRAMPercentage
          value: '-XX:MaxRAMPercentage=80'
        - name: GC_OPTS
          value: ' -XX:+UseStringDeduplication -XX:CICompilerCount=10 -XX:ConcGCThreads=3 -XX:G1ConcRefinementThreads=6 -XX:ParallelGCThreads=10 -XX:MaxGCPauseMillis=500 -XX:InitiatingHeapOccupancyPercent=30'
        - name: JAVA_OPTS

The memory and CPU limits are set as

          resources:
        requests:
          memory: "10Gi"
          ephemeral-storage:  2Gi
          cpu: 50m
        limits:
          memory: "12Gi"
          ephemeral-storage:  5Gi
          cpu: 5

The problem which is seen is that committed heap usage is becoming quite high memory is not getting evicted and returned back to OS, thats where eventually application is leading to slowness and eventually OOM.

Any idea why is this happening in committed heap when seen using datadog is almost twice as heap usage in so lots of space jVM is reserving in for committed heap.

Can you please suggest whats causing this set in config.

Scientist
  • 1,458
  • 2
  • 15
  • 31
  • 1
    IIRC, G1GC needs to be explicitly configured to return memory, so by default once it has claimed memory, it will hold on to it. There is obviously also the possibility that you have a memory leak, otherwise you wouldn't get a "slowness" (usually caused by excessive full GCs) leading to an OOM. – Mark Rotteveel Apr 24 '23 at 09:26
  • I dont think it has to be configured to return memory back to OS . as per this JEP https://openjdk.org/jeps/346 it will automatically do it – Scientist Apr 24 '23 at 10:55
  • Then you probably have a memory leak – Mark Rotteveel Apr 24 '23 at 10:56
  • memory leak i checked is not there in whats happening is memory release is happening very slowly i noticed for around 6-7 hrs the committed heap was high and shown on datadog too in – Scientist Apr 24 '23 at 11:02
  • 1
    idle GC has been implemented but is not necessarily enabled by default. `$ java -XX:+UseG1GC -XX:+PrintFlagsFinal 2>&1 | grep G1PeriodicGCInterval uintx G1PeriodicGCInterval = 0 {manageable} {default} ` – the8472 Apr 25 '23 at 21:25

0 Answers0