call collectgarbage per frame to avoid spikes in animations