1296
votes

Scripting: Garbage Collection sgen-gc

Scripting

-

-

The current mono garbage collection is sub-standard and requires work around for any title considering console style gameplay. All instantiates and destroys are accompanied by unacceptably large GC spikes (in web and stand-alone)

I tested the Unity military demo on 3.0 in the profiler to verify that this has not been addressed.

The sgen-gc option generally has far superior results. http://www.schrankmonster.de/2010/09/01/taking-the-new-and-shiny-mono-simple-generational-garbage-collector-mono-sgen-for-a-walk/

While there are time-consuming memory pool work arounds, not all of them are available from script without working around large swathes of audio and effects code (And of course the unshippable OnGui)

Unity could really compete against other PC engines with reliable frame rate from scripts, so I can't encourage this feature strongly enough

Comments (39)

76a10d1465b9ead8a6ad8a2804a27b00?d=mm
TheOtherMonarch
Aug 22, 2013 23:45

I have noticed a fairly large number of commits on Git relating to the GC post 3.2. That combined with the fact that they are only hosting Mac OS X builds leads me to think that 3.2 was stillborn.

Maybe they will finally really reach stable with 3.3

58d6dfe6a233a018e8ffd07d64c602df?d=mm
pragmascript
Aug 21, 2013 19:16

whats new in mono 3.2:
http://de.slideshare.net/migueldeicaza/monkey-space-2013

58d6dfe6a233a018e8ffd07d64c602df?d=mm
pragmascript
Aug 21, 2013 19:16

whats new in mono 3.2:
http://de.slideshare.net/migueldeicaza/monkey-space-2013

76a10d1465b9ead8a6ad8a2804a27b00?d=mm
TheOtherMonarch
Jul 26, 2013 16:23

Ok so mono 3.0 finally reached stable at 3.2

http://www.mono-project.com/Release_Notes_Mono_3.2#New_in_Mono_3.2

76a10d1465b9ead8a6ad8a2804a27b00?d=mm
TheOtherMonarch
Jul 23, 2013 02:51

The new GC did not even become the default GC until 2 weeks ago.

76a10d1465b9ead8a6ad8a2804a27b00?d=mm
TheOtherMonarch
Jul 23, 2013 02:48

Mono 3.1.2 is still a Beta. Realistically unity should not update mono until the mono 3.0 branch reaches stable.

Even then rushing out and upgrading at the first stable is probably wrong. Better to wait at least a few months after first stable. So at least 6 or 7 more months.

9d99db917c226da985dec0e856f3e49a?d=mm
TH Interactive
Jul 14, 2013 08:24

+10. Working on Mines of Mishap for iOS and the garbage collector is giving me lots of grief.
Have spent hours and hours on making workarounds but something that is available (mono 3.0+) that could solve my nightmares would be very very appreciated.
New features are nice and all, but memory management is so pivotal to the performance of every engine/game it surprises me greatly that this hasn't been done yet.
Unity please, please consider this issue above nicities like decals, guis etc. Not that those aren't important, but this is a foundational engine issue that simply must be solved for console and mobile platforms.

58d6dfe6a233a018e8ffd07d64c602df?d=mm
pragmascript
Jul 06, 2013 00:44

Mono 3.0 is an update to Mono 2.10 based on the master branch of github, it is not a minor upgrade to 2.10. Mono 3.0 was released on October 18th 2012.

We will continue to bug fix and update Mono 2.10 for another six months for users that can not upgrade to Mono 3.0.

8f75ca4859514fe931f530492646bc15?d=mm
Smooth P
Mar 01, 2013 00:11

It's outright shameful that we're still on this PoS GC, writing bad, maintenance nightmare code and burning productivity on what is essentially a solved issue. I mean, it's freaking disgusting that Unity 4 shipped with what has been an extreme pain point for years. Unity is rotting from the inside, but yeah, how 'bout them new effects!

58d6dfe6a233a018e8ffd07d64c602df?d=mm
pragmascript
Jan 09, 2013 21:31

mono 3.0.3 is released. and it now has a concurrent garbage collector.

http://www.mono-project.com/Release_Notes_Mono_3.0#New_in_Mono_3.0.3