-
Notifications
You must be signed in to change notification settings - Fork 451
Closed
Labels
Milestone
Description
While investigating ppy/osu#11800, we have basically identified the root cause to be the presence of objects with finalizers (even if they have been suppressed) existing in the finalizer queue.
Using the following model classes:
public class NonFinalizingThing
{
public NonFinalizingThing()
{
}
}
public class FinalizingThing
{
public FinalizingThing()
{
}
~FinalizingThing()
{
}
}Constant allocations without finalizer:
for (int i = 0; i < 100000000; i++)
{
var thing = new NonFinalizingThing();
}With:
for (int i = 0; i < 100000000; i++)
{
var thing = new FinalizingThing();
GC.SuppressFinalize(thing);
}Note the pause time increasing from 0.1ms to around 7ms.
bdach

