title: Java garbage collection: minor, major, full
body: <p>I am trying to get a hang on garbage collection in a large enterprise Java application. I have the GC logs and started looking into them using various tools - the screenshot here is done using <a href="https://github.com/chewiebug/GCViewer" rel="nofollow noreferrer">GCViewer</a>. (Sadly there is no logs with more verbose GC info...)</p>
  
  <p>I was also reading up on the Java Hotspot VM garbage collection, which we are using.</p>
  
  <p>But I am still somewhat confused: below is a screenshot of a zoomed in section of the GC graph.</p>
  
  <p><img src="https://i.stack.imgur.com/c1EEU.png" alt="Zoom on garbage collection graph"></p>
  
  <p>There are three things going on here:</p>
  
  <ol>
  <li>There is the "small zigzag" of the blue line (which you can hardly see): from what I understand these are <em>minor</em> gc cycles happing in Young space.</li>
  <li><p>There is the black bar, which is a blocking 10s full GC, as can be seen in the logs:  </p>
  
  <pre><code>1751585.394: [Full GC 1433326K-&gt;660045K(1552832K), 10.1157600 secs]
  </code></pre></li>
  <li>Then there is the "big zigzag" of the blue line (manifesting in the drop on the left). <strong>This is what confuses me.</strong></li>
  </ol>
  
  <p>The logs for pattern #3 don't mark it as full GC, but look similar to the rest...</p>
  
  <pre><code>    1749795.648: [GC 1299871K(1552832K), 0.0402933 secs]
  </code></pre>
  
  <ul>
  <li>So is this a minor GC as well?</li>
  <li>If yes, why are there two different patterns of minor garbage collects happening at the same time (#1 and #3)?</li>
  <li>Or is there something else between minor GC in Young space and full GC in Tenured?</li>
  </ul>
  
  <hr>
  
  <p><em>Edit. Some additional info:<br>
  GC used: Concurrent Mark-Sweep GC<br>
  Throughput is 93.8 %<br>
  Longest Pause: 10.116 seconds<br>
  Time Paused: 6.21%</em></p>