Hacker News new | ask | show | jobs
by sgrove 2281 days ago
It's not entirely surprising, but one might imagine a different approach: always allocate a 1% buffer for an unexpected GC.

It's not a very satisfactory answer (and there are likely much better tradeoffs to be made), but given the 10x and 1% comparison (not entirely apples to apples though) the comment sounds a bit more interesting.

2 comments

The problem is that with most GC algorithms 1% of the frames take 2x (or even 20x) as long, not that individual frame times vary by 1%.
How do you allocate a 1% buffer of time? The GC issue in games (or any other timing sensitive application) is about the "world freezing", not memory. Which is why incremental GC is a thing. At best, you're borrowing time.