3 ms·
Generational garbage collectors achieve good/better performance by more frequently sweeping one or more heaps with younger items before promoting the survivors
by hga 12y ago
Generational garbage collectors achieve good/better performance by more frequently sweeping one or more heaps with younger items before promoting the survivors to an older heap, based on the thesis is that most garbage is short lived.
Modern marking collectors are evidently pretty fast and many collect mostly concurrently with running code, eventually the whole heap has to be collected and the "world stops". The standard (being replaced?) Hotspot collector, without any special hardware tricks, was said in the Pauseless GC paper to sweep 1 GiB/second on standard x86_64 hardware.
As in, when it has to do a full collection and stops everything else it goes that slowly, or at least it can be way too slow for many users with 10s or 100s of GiB of memory.
Pauseless and C4 use hardware tricks, C4 on standard hardware, like using large pages, and making mass VM operations in one (added to Linux) call, only invalidating the TLB at the end. Oh, yeah, however efficient/inefficient they are, they collect concurrently with running code.