3 ms·
They can't really provide that guarantee. It's possible for lower allocation rates but what happens when 10ms is not enough time to keep up with all of the new
by Rohansi 1y ago
They can't really provide that guarantee. It's possible for lower allocation rates but what happens when 10ms is not enough time to keep up with all of the new allocations? At some point it'll need to stop the world because it's not able to do a complete cycle.
I like the way .NET does it where you can define regions to have the GC avoid running in [1]. You just need to declare how much memory the region should be able to allocate and it wouldn't run the GC unless it is exceeded. This is great for things like games where it's best to let the GC run while the GPU is rendering/presenting (note: not supported in Unity because they use Mono).
[1] https://learn.microsoft.com/en-us/dotnet/api/system.gc.trystartnogcregion?view=net-9.0 https://learn.microsoft.com/en-us/dotnet/api/system.gc.tryst...