Hacker News new | ask | show | jobs
by hgo 597 days ago
Would it be possible for the allocator/GC to know what allocations are made within a request and make a generation for specifically for it? Allocations too big to fit would be made like usual
1 comments

That's already what we effectively have.

Since objects cannot be promoted to the old generation inside the request cycle, objects in the new gen are request allocated objects.

So if we were to eagerly trigger a minor GC after a request, we'd have very little objects to scan, and only need to sweep garbage, which is only a small fraction of time spent in GC.