What is being garbage collected?

It’s probably the mouse and keyboard code.

Conversion of numerical text into numbers which is a c# thing itself can be a culprit too, though that’s solvable.

These are the primary things that create garbage in mg internally. Unfortunately you can’t do anything about the keyboard mouse as i think this is coming from the librarys mg depends on.

Anytime you call new you actually are creating garbage however its the collections of garbage that causes stutters.

// very bad
var t = new T(0);
for(int i = 0; i  < 100; i++)
{
t = new T(i);
t.Draw();
}

// much more preferable.
var t = new T();
for(int i = 0; i  < 100; i++)
{
t.x = i;
t.Draw();
}