title: InitiatingHeapOccupancyPercent is set to 40 yet old gen memory going beyond 60 percent in G1GC
body: <p>I am trying to solve a problem where the heap memory is going beyond 90 percent in my java service.</p>
  
  <p>Below is the heap configuration I am using, </p>
  
  <pre><code>-Xms6144m \
                  -Xmx6144m \
                  -verbose:gc \
                 -XX:G1HeapRegionSize=2097152 \
                 -XX:+PrintGC \
                 -XX:+PrintFlagsFinal \
                 -XX:InitiatingHeapOccupancyPercent=40 \
                 -XX:NewRatio=2 \
                 -XX:+PrintGCDetails \
                 -XX:+PrintGCDateStamps \
                 -XX:+PrintAdaptiveSizePolicy \
                 -XX:+PrintTenuringDistribution \
                 -XX:+UseGCLogFileRotation \
                 -XX:NumberOfGCLogFiles=10 \
                 -XX:GCLogFileSize=50M \
      -XX:+UnlockExperimentalVMOptions \
    -XX:+UseG1GC -XX:+UseStringDeduplication \
    -XX:+UseCGroupMemoryLimitForHeap \
    -XX:+ParallelRefProcEnabled
    -XX:+OptimizeStringConcat
    -XX:MaxRAMFraction=2 \
    -XshowSettings:vm
  
  </code></pre>
  
  <p>The problem is my old gen is gradually getting filled up and over the time the lower point to which the heap is going after GC is increasing, my graph looks something like this :</p>
  
  <p><a href="https://i.stack.imgur.com/n4CwC.png" rel="noreferrer"><img src="https://i.stack.imgur.com/n4CwC.png" alt="enter image description here"></a></p>
  
  <p>Can you suggest if my heap params are correct and are they conflicting in the way they are configured or how can I reduce the max heap getting used?</p>