This has probably nothing to do with GC tuning[1] or with Java&#x27;s GC being slow (or any other GC), and most likely to do with either a bug in the program (a leak) or a misunderstanding of how the program uses memory. It&#x27;s not the &quot;GC ruining your day&quot;, but the GC not being able to fix a bug in your program and&#x2F;or cram a 5 GB RAM usage into a 4 GB heap.<p>[1]: Which is relevant if you&#x27;re trying to turn a 100ms pause into a 15ms pause, or get rid of the 2sec pause you get once every few hours.