4 ms·
GC also has its downsides: - Marking and sweeping cause latency spikes which may be unacceptable if your program must have millisecond responsiveness. - GC ha
by gunnarmorling 1y ago
GC also has its downsides:
- Marking and sweeping cause latency spikes which may be unacceptable if your program must have millisecond responsiveness.
- GC happens intermittently, which means garbage accumulates until each collection, and so your program is overall less memory efficient.
With modern concurrent collectors like Java's ZGC, that's not the case any longer. They show sub-millisecond pause times and run concurrently. The trade-off is a higher CPU utilization and thus reduced overall throughput, which if and when it is a problem can oftentimes be mitigated by scaling out to more compute nodes.