Search Feedback

1726
votes
Planned

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

Response avatar

Schubkraft

May 17, 2017

It is under research. We already updated the Mono compiler and after we upgraded the .NET/mono runtime (currently in the 2017.1 beta) this is next on the list.

Comments (48)

  1. 58d6dfe6a233a018e8ffd07d64c602df?d=mm

    pragmascript

    Aug 21, 2013 19:16

  2. 58d6dfe6a233a018e8ffd07d64c602df?d=mm

    pragmascript

    Aug 21, 2013 19:16

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

  4. 76a10d1465b9ead8a6ad8a2804a27b00?d=mm

    TheOtherMonarch

    Jul 23, 2013 02:51

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

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

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

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

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

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

  10. 20007037328b2334e527d7a5d1359333?d=mm

    Gorgor

    Nov 18, 2012 21:21

    +10

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

(9356)

2D

(241)

Ads

(43)

AI & Navigation

(71)

Analytics

(106)

Animation

(330)

Asset Store

(243)

Assets

(497)

Audio

(159)

Cloud Build

(102)

Collaborate

(33)

Docs & Tutorials

(203)

Editor

(2160)

Everyplay

(13)

Game Performance Reporting

(15)

General

(831)

Graphics

(791)

GUI

(373)

Input

(150)

Licensing

(77)

Networking

(163)

Physics

(349)

Platforms

(413)

Profiling & Optimization

(72)

Runtime

(164)

Scripting

(1044)

Terrain

(152)

WebGL

(134)