title: Java GC on low memory stop and crash program
body: <p>I am using parallel GC in my java program. But when jvm have less then ~400mb of free memory GC starts to consume all of CPU. And after some time jvm crash with <code>java.lang.OutOfMemoryError: GC overhead limit exceeded</code>. But i am printing the amount of free memory with <code>Runtime.getRuntime().freeMemory()</code>, and i am sure that jvm have ~400mb of free space. I tried to set <code>-XX:MinHeapFreeRatio</code> to 1 or 5 but it made everything worst.</p>
  
  <p>How to config GC or which one should i choose to prevent it from consumimg all of CPU and crashing jvm?
  My jvm flags is <code>-XX:+UnlockCommercialFeatures -XX:+FlightRecorder -Xmx3800m -server -Djava.library.path="native_libs"</code></p>