Search Unity

Feedback Incremental GC feedback thread

Discussion in 'Experimental Scripting Previews' started by jonas-echterhoff, Nov 26, 2018.

  1. Arthur-LVGameDev

    Arthur-LVGameDev

    Joined:
    Mar 14, 2016
    Posts:
    67
    We now have this deployed in production and it's working well. The issues we ran into & that I originally mentioned turned out to be unrelated, were instead related to UI onValueChanged events firing that previously didn't fire in object's state which was causing a stack overflow. I think the latest 2019.1x is actually catching it now even, instead of crashing. :)

    Customer reports are mostly positive regarding the speed/performance improvements from enabling the incremental GC; though we've been making optimizations as well, so is difficult to bifurcate and attribute the reports, but overall no complaints here.

    That said, is a win for sure and a good stride; next step, a more modern generational GC? A guy can hope! =D

    Out of curiosity, and IIRC from reading this thread originally, the incremental is only in builds? Will it be coming to the editor at some point in the future? Right now it's probably my #1 issue with Unity: editor runs at ~50% performance of builds. Which means that debugging user-submitted issues via their save games = extremely painful.

    Well, to clarify (and apologies for the slightly off-topic rant), really my #1 complaint with Unity is just performance in general. DOTS looks and seems great long-term, but it feels to be in varying states of beta / API change, and frankly it's still very unclear to me on what the best way [or IF there is even a workable/best way in Unity right now] to handle & render tons (100k+) of moving quads/2D within Unity -- and unfortunately we need something we can leverage much sooner than later.

    Anyways, not to be sour at all; Rome wasn't built in a day and each step forward by the respective teams is great, welcomed, and appreciated. Definitely a very good and tangible step forward. Ty! :)
     
    Last edited: Jun 16, 2019
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,633
    Thanks for the feedback!

    Editor support (and support for all other platforms, except for WebGL) is coming in 19.2.
     
  3. SugoiDev

    SugoiDev

    Joined:
    Mar 27, 2013
    Posts:
    244
    Is it Editor support enabled in any of the 19.3 alphas?
     
  4. Gabrielmtn

    Gabrielmtn

    Joined:
    Jun 13, 2017
    Posts:
    2
    Jonas I'm not a unity dev, but a web dev who is nonetheless curious about spikes and stutters occurring in an ambition FPS unity game, Escape from Tarkov, which is under development, and doing a port from 2017 to 2018 soon.

    My suspicions are that it may relate to GC, or possibly asset handling as it relates to LOD, again, as a non Unity dev, and a non-team member I don't have a lot to go on.

    My question is simply this: Do you have any advice, or resources you'd recommend for Unity 2018 users relating to GC best practices, in lieu of using the incremental feature? Maybe advice on how Unity devs might diagnose the precise root of the issues?

    My goal is to start a thread in the game's subreddit where the early users can share notes and experiences to possibly support the dev's debugging of the issue, and I'd love to include any of your insight on GC spikes especially.
     
  5. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    4,118
  6. Gabrielmtn

    Gabrielmtn

    Joined:
    Jun 13, 2017
    Posts:
    2
    I haven't, but I'll look into it. The reason I asked Jonas about ways one might hook into and improve 2018's GC functionality to bring it closer to 2019 is that I think that general advice would probably fall within the devs "what we've tried" list, while Jonas might be able to recommend patterns to mimic the performance 2019 gets.
     
  7. StefanStrategis

    StefanStrategis

    Joined:
    May 7, 2018
    Posts:
    1
    As our WebGL application is severely limited by GC from reading many large JSON files continuously, I was wondering if there is any update on WebGL support for the Incremental GC?
     
  8. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    273
    When I enabled incremental gc, I've got gc spikes from garbage created on other threads. In other words - this doesn't happen in 'normal' mode, and it seems like every thread is responsible for own garbage, but with incremental, garbage from all my threads are collected at main thread, so for such case it's step backward unfortunately.
     
  9. joncham

    joncham

    Unity Technologies

    Joined:
    Dec 1, 2011
    Posts:
    251
    In "normal" mode or incremental mode the GC is global. All threads allocate from a single heap and collections pause all threads. Please describe in more detail the issue you are hitting or file a bug with steps to reproduce it. Thanks!
     
  10. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    273
    If it's global then something in Unity is not working as it should for a very long time and consistenly, because I never have GC spikes if garbage objects are created on other than main threads. Very easy to test out, just create thread that will do a lot of garbage over long time, and observe profiler - nothing will show up in terms of gc. So until now I was sure every spawned thread manages 'own garbage', beacause that's what Unity behaviour suggest, and it's been like this since I remember.
     
  11. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,609
    Could you post some code here how you make your threads? I'm guessing it's not in managed unity land?
     
  12. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    273
    It's buried a little under other API, but in the end it's normal C# new Thread(), so it's normal managed thread.