Search Feedback

1348
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 (41)

  1. 3060f55be4a0eb6e7745cd8572619a27?d=mm

    JDC15

    Aug 12, 2014 01:29

    +10. I've spend countless hours debugging frame spikes, all caused by the GC. This is my only pain point with Unity right now.

  2. 4d30c5f676e9e3441483f17ce7dd35c5?d=mm

    Thromshall

    Jun 05, 2014 22:10

    This would be huge for my project! It involves a lot of instantiations (as it is a game where players build levels) and what not, and I'm sure a Mono Runtime upgrade would do my game's performance some good!

  3. 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

  4. 58d6dfe6a233a018e8ffd07d64c602df?d=mm

    pragmascript

    Aug 21, 2013 19:16

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

  5. 58d6dfe6a233a018e8ffd07d64c602df?d=mm

    pragmascript

    Aug 21, 2013 19:16

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

  6. 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

  7. 76a10d1465b9ead8a6ad8a2804a27b00?d=mm

    TheOtherMonarch

    Jul 23, 2013 02:51

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

  8. 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.

  9. 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.

  10. 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.

Your opinion counts

Help us make things better. Share your great idea for improving Unity or vote for other people’s.

Log in to post a new idea

Categories

All

(4748)

2D

(73)

Assets

(451)

Audio

(83)

Editor

(1139)

General

(407)

Graphics

(342)

GUI

(198)

Input

(98)

Licensing

(69)

Networking

(53)

Physics

(165)

Platforms

(248)

Runtime

(94)

Scripting

(598)

Terrain

(81)

Web Player

(90)