3 ms·
I think Go shows that that's a false dichotomy. Go can GC very quickly, almost without pauses, and the pauses are sub millisecond. That should be fast enough fo
by tgv 4y ago
I think Go shows that that's a false dichotomy. Go can GC very quickly, almost without pauses, and the pauses are sub millisecond. That should be fast enough for almost all backends. Capping isn't great, although doable if you've got a steady workload.
- origin_path 4y agoThe argument for the Java behavior doesn't depend on how long pauses are. It's purely about efficiency. If your runtime is collecting then it's not spending that CPU time on your apps workload. If you're GCing to reduce your heap from 300M to 100M when you have 16GB free, your server is running slower than it needs to because GC work is more efficient when clearing a lot of garbage from the heap. Fundamentally with GC there's a throughput vs memory usage tradeoff. Go faces the same issue which is why GOGC exists: https://tip.golang.org/doc/gc-guide#GOGC https://tip.golang.org/doc/gc-guide#GOGC