3 ms·
I don’t believe it is as easy as that. What happens when your program have accumulated plenty of long-living objects? Your case probably works due to having onl
by kaba0 5y ago
I don’t believe it is as easy as that. What happens when your program have accumulated plenty of long-living objects? Your case probably works due to having only objects with short lifetimes - but your GC’s pause time will generally grow with the heap size. Not even generational GCs solve that in the general case.
Java’s low-latency GC, ZGC moves almost the whole work to parallel threads by accepting the trade-off of slightly slower barriers. But in reward it can decouple the pause time’s length from the heap size which is the key here.
- adgjlsfhk1 5y agoThe whole point of generational GC is that that your pause times don't grow with the old objects. I think concurrent sweep makes a lot of sense (it's basically free), but concurrent mark has major performance compromises. It's not just the longer barrier, it also adds an extra indirection to all your memory accesses. Full concurrent may be right for some use cases (where you *need* very low pause times), but it comes at a considerable cost.
- kaba0 5y agoI don’t think that generational GC can totally decouple pause times from heap size in the worst case, which is what is important for latency-oriented workloads.
- adgjlsfhk1 5y agoFor stuff like games, it probably does it well enough. If you drop a frame every minute, that's not a major problem.