title: Java 8 metaspace garbage collection
body: <p>A java process that I'm running performs consistently well in the first hour or so that it runs. However, performance then rapidly degrades. When profiling I found that the metaspace garbage collection happened fairly frequently until the hour mark and then got out of control:</p>
  
  <p><a href="https://i.stack.imgur.com/p3gcG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/p3gcG.png" alt="enter image description here"></a></p>
  
  <p>I'm fairly sure I'll be able to fix this using the -XX:MaxMetaspaceSize option. However, I'd like to know more about why this behaviour might be occurring. I can't imagine why the garbage collection algorithm would behave like this. Does anyone have an explanation or advice about a better fix? Thanks</p>