Hacker News new | ask | show | jobs
by dikei 1280 days ago
No, that's not now you should tune the modern JVM.

GC will always happen no matter how much heap size you allocate: large heap size will make GC happen less frequently, but depending on the algorithm, it will also increase how much time is needed for each collection. The key point for GC tuning is to keep total GC time and pause time under control with as little memory as possible.

* First, you have to setup monitoring for the garbage collection time: turn on metrics collection and details garbage collection logging.

* Second, tune your total GC time so that it's under 5% or less. Start with a reasonably small max heap size, says 256MB, and keep increasing it if the GC time is still too large. Try to keep the max heap size under 32GB to take advantage of "Compressed OOPs"

* Third, you only need to use more advance flags if you detect large GC pause in your GC logging. Otherwise, you're done.

1 comments

Wow...