When will new Mono GC be used in Unity? I heard that the new one is way faster and multithreaded. Currently in my project calling GC.Collect every 10 seconds takes 15-20 milliseconds without any garbage to collect.
It’s coming, but gonna be a while - in the Unity Roadmap, it’s listed as being “researched” (as opposed to in-development or planned for a specific Unity version). In Unity 2017.1, support for a new version of Mono for .Net 4.5 compatibility is experimental, the new Garbage Collector probably isn’t going to be implemented until after the 4.5 compatibility Is known to be solid enough to lose “experimental” status.
I fear that with the current one I will have a little animation stuttering here and there when I lose frames with vsync. That’s why I ask.
You will have to wait too long for it to be relevant for your current project*. Even when it is out, it will be buggy and you will still have some performance issues. I don’t think any GC is able to turn 20ms into 1ms. That’s indicative of a huge, huge amount of objects in memory, rather than garbage. Possibly a lot of things cross referencing each other too…
There’s strategies we can do to deal with that if you’re interested, not going to impose of course.
*my usual answer to these things
With reference scan in a separate thread it could take 1ms in the main thread.
Any news about this?
I’ve noticed that the feature is now in the “Development” section on the roadmap. Any chance for a release in the 2018.x cycle?
Also, can you please give us an estimation on the performance gain from this? I’m looking forward to it as I have spikes of 15ms every 10 seconds or so due to the GC. What can I expect from the new GC?
Thanks!
I hope not, there’s enough experimental features already breaking that release.