Search Feedback

1419
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 (45)

  1. 231f9c2a9be4c7ff4b67201a38c1e0d0?d=mm

    drakmirvaunt

    Jan 31, 2016 04:22

    +10 Huge productivity waste with unity so far. Implemented our own object pools, data structures, sort algorithms, random number generators, etc. All of this to avoid GC spikes on non desktop hardware.

    Then realized it is a waste of effort since we started to pull in 3rd party libraries which aren't built this way and now have to deal with GC spikes anyway.

    This has been a large drag on our project.

    2nd only to not being able to use C# tasks (but that would need another 10 votes....)

  2. 284beac32566a94c08ef5db37075489c?d=mm

    whale

    Jan 16, 2016 17:57

    10 votes. There is no more important issue on this board.

  3. 89648c1019679041b7fb111cbbcb36e7?d=mm

    SomeGuy22

    Aug 03, 2015 18:03

    Built in automatic Object Pooling would be nice too...

  4. F8b25df4d1b6e783c407e25da7642490?d=mm

    Ruedii

    Jun 05, 2015 08:56

    People have been asking for this for 5 years now.

    It would dramatically improve performance on Unity.

    Why hasn't it been implemented?

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

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

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

  8. 58d6dfe6a233a018e8ffd07d64c602df?d=mm

    pragmascript

    Aug 21, 2013 19:16

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

  9. 58d6dfe6a233a018e8ffd07d64c602df?d=mm

    pragmascript

    Aug 21, 2013 19:16

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

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

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

(6768)

2D

(160)

Ads

(16)

AI & Navigation

(35)

Analytics

(44)

Animation

(207)

Asset Store

(129)

Assets

(433)

Audio

(123)

Cloud Build

(52)

Docs & Tutorials

(123)

Editor

(1583)

Everyplay

(10)

Game Performance Reporting

(6)

General

(585)

Graphics

(517)

GUI

(257)

Input

(123)

Licensing

(58)

Networking

(94)

Physics

(258)

Platforms

(339)

Profiling & Optimization

(44)

Runtime

(128)

Scripting

(773)

Terrain

(131)

WebGL

(107)