title: Why there is performance degradation after ~6 hours of Java 9 G1 work without the actual increase in load?
body: <p>I switched 1 instance (2 vCPU, 2GB RAM, load ~4k req/sec) to Java 9 (from latest Java 8). For a while, everything was fine and CPU usage was same as before. However, after ~6 hours CPU consumption increased by 4% (from 21% to 25%) for no reason. I had no traffic spikes, 
  no memory consumption increased, no metric changes (I have counters for every method within code). Nothing.</p>
  
  <p>I left this instance untouched for ~12 hours expecting it will revert back. But nothing changed. It just started consuming more CPU.</p>
  
  <p><code>top</code> command showed that the instance had more CPU spikes than usually for the Java server process. I read recently that G1 is not suitable for the high throughput. So I made a conclusion that reason could be in G1.</p>
  
  <p>I restarted instance with:</p>
  
  <pre><code>java -XX:+UseParallelGC -jar server-0.28.0.jar
  </code></pre>
  
  <p>And after ~20 hours of the monitoring, everything is fine as before. CPU consumption is on the level of 21% as it was many days before.</p>
  
  <p>CPU usage right after Java 9 deployment (6h scale):</p>
  
  <p><a href="https://i.stack.imgur.com/CX2Jb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CX2Jb.png" alt="enter image description here"></a></p>
  
  <p>CPU increase after 7 hours + 12 hours "untouched" (7d scale):</p>
  
  <p><a href="https://i.stack.imgur.com/R3nKP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R3nKP.png" alt="enter image description here"></a></p>
  
  <p>CPU after -<code>XX:+UseParallelGC</code> (24h scale):</p>
  
  <p><a href="https://i.stack.imgur.com/g1F8v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g1F8v.png" alt="enter image description here"></a></p>
  
  <p>So my question is - is that expected behavior for the G1? Anyone else sees something similar?</p>
  
  <p>Ubuntu 16.04 x64</p>
  
  <pre><code>java version "9"
  Java(TM) SE Runtime Environment (build 9+181)
  Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
  </code></pre>
  
  <p><strong>EDIT 03.01.2019</strong></p>
  
  <p>Tried to run one the same server with G1 on the java 10.0.2:</p>
  
  <pre><code>java version "10.0.2" 2018-07-17
  Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
  Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
  </code></pre>
  
  <p>G1 consumes 40% more CPU than <code>UseParallelGC</code> right after the server restart.</p>