V8 runs two kinds of collections, the scavenge and the full mark-sweep-compact. What's the real difference, and if my latency is suffering, which one do I blame?
Strong candidates tie each collector's algorithm to its pauses, weigh copying cost against marking cost, and know what modern V8 actually runs concurrently
So the scavenge is the minor GC, it cleans up new space. New space is small and most of what's in there is already dead, so scavenges finish fast, around a millisecond I think, and they run all the time. Mark-sweep-compact is the major GC and it goes over the entire heap. It marks everything that's still reachable, sweeps the dead objects, and compacts memory to cut down fragmentation. That's the expensive one, and historically that's where the noticeable pause spikes came from. Newer V8 softens this with incremental and concurrent techniques, so a lot of the marking happens in the background and the stop-the-world part stays short. For latency you basically watch the major GC. Frequent scavenges are normal and cheap. Long or frequent major collections show up directly in your tail latency.