Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Particles leak memory in Unity 5.5

Discussion in 'Editor & General Support' started by Zenix, Dec 14, 2016.

  1. Zenix

    Zenix

    Joined:
    Nov 9, 2009
    Posts:
    213
    Unity 5.5 has introduced a pretty severe issue where particle systems continuously leak memory.

    I logged a bug about it (861347) but the response from Unity was simply that it appears fixed in the 5.6 beta.

    It may not be all particle systems, but I've uploaded a pretty simple test project that demonstrates the issue.
    https://www.dropbox.com/s/krw2yvy55dlt3au/ParticleLeak.zip?dl=0

    If you build and run the project in 5.5 and observe the memory usage in task manager, you can see that it grows continuously until the application crashes.

    Putting this out there as a warning to other devs more than anything, if you're having memory issues with 5.5 you might want to start by looking at particles.

    This happens in both 5.5.0f3, and 5.5.0p1. I've reproduced it on Windows standalone and iOS.
     
  2. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    228
    Hi, @Zenix, I'm also fine-tuning my tvOS app.
    In my case, I play the game inside Xcode and monitor the performance using both Xcode memory profiler and Unity profiler.

    The memory profiler in Xcode showed continuous steep memory growth. But in Unity profiler, the memory doesn't grow. It stays the same no matter how long I play.

    After changing 'foreach' statements to 'for', the steep growth halted, but it does still get bigger bit by bit. About an hour later the memory increased by ~20mb, but the profiler shows that the total memory usage doesn't chabge.
     
  3. SaraCecilia

    SaraCecilia

    Joined:
    Jul 9, 2014
    Posts:
    675
    I've pinged the dev team and will reach out to QA next to get this in the process.
     
  4. Spellbook

    Spellbook

    Joined:
    May 21, 2015
    Posts:
    29
    What is the status of this? It's a show-stopping problem preventing product launch.
     
  5. SaraCecilia

    SaraCecilia

    Joined:
    Jul 9, 2014
    Posts:
    675
    Hey, can you test if 5.5.0p3 solves the issue? There should be a fix in that patch.
     
  6. Spellbook

    Spellbook

    Joined:
    May 21, 2015
    Posts:
    29
    We've been running 5.5.0p3. Most definitely not fixed -- Simple scene with just a rain effect duplicated 20 times climbs memory use to 5gb in under a minute, and eventually crashes the editor. When stopping the scene, Unity editor never releases memory (according to Task Manager). Unity Profiler does not show the memory use.
     
  7. SaraCecilia

    SaraCecilia

    Joined:
    Jul 9, 2014
    Posts:
    675
    Gotcha, I've pinged QA to have a look (and possibly reopen the case.) Will hopefully know a bit more soon.
     
  8. Spellbook

    Spellbook

    Joined:
    May 21, 2015
    Posts:
    29
    Can confirm it is nested sub-emitters. Disabled the rain's sub-emitter and memory leak went away, even with 5,000 instances.
     
  9. SaraCecilia

    SaraCecilia

    Joined:
    Jul 9, 2014
    Posts:
    675
    Okay sorry, it did not make it into p3 after all. Testing on p4 is currently taking place and it seems that the issue is fixed there, so we will release p4 at some point next week.
     
  10. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,281
    Hey,

    I wanted to post an update on this issue.

    Unfortunately there has been some confusion over whether this bug is fixed in p3, and again in p4. This has resulted in us not investigating it further, due to incorrect reports that it was fixed in upcoming patches, when in fact it was not.

    The bad news is that this means it is not fixed in the upcoming 5.5.0p4 :(

    But the good news is that I am now looking at this as a matter of urgency, and will make sure it is fixed as soon as possible.

    Sorry for the conflicting reports on this bug being fixed/not fixed!
    The issue tracker link for this item is here: https://issuetracker.unity3d.com/is...tters-on-particle-systems-causes-memory-leaks
     
  11. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,281
    Hey, I can confirm that the fix for this issue is heading out in 5.5.1p1.

    Thanks for your patience!
     
    karl_jones likes this.
  12. Andrey-Postelzhuk

    Andrey-Postelzhuk

    Joined:
    Nov 26, 2013
    Posts:
    75
    @richardkettlewell When are you going to release 5.5.1p1? The last patch version is 5.5.0p4 now.

     
  13. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,281
    We hope to release it this week, but it's never certain - it depends if QA find anything awful in it :)
     
  14. zhouzhongliang

    zhouzhongliang

    Joined:
    May 7, 2018
    Posts:
    1
    5.6.6 again
     
  15. GameJob2017

    GameJob2017

    Joined:
    Mar 1, 2017
    Posts:
    18
    I think this problem happens again in Unity 2018.4. Would Unity developers please take a look ?

    Thank you so much.
     
  16. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,281
    Hi, it will be best if you can submit a new bug + reproduction project.

    You probably can't be sure the reproduction project from the old case will exhibit the issue, it might be subtly different to your situation, and you won't receive any updates as to the results of re-testing the old bug. (I can't manually keep track of forum threads outside of our bug tracking system; there are too many unfortunately)

    That said, if you really want me to ask QA to re-test the old bug, I will :)