Particles leak memory in Unity 5.5

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.

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.

I’ve pinged the dev team and will reach out to QA next to get this in the process.

What is the status of this? It’s a show-stopping problem preventing product launch.

Hey, can you test if 5.5.0p3 solves the issue? There should be a fix in that patch.

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.

Gotcha, I’ve pinged QA to have a look (and possibly reopen the case.) Will hopefully know a bit more soon.

Can confirm it is nested sub-emitters. Disabled the rain’s sub-emitter and memory leak went away, even with 5,000 instances.

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.

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 :frowning:

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: Unity Issue Tracker - [Shuriken] Using Sub Emitters on Particle Systems cause memory leaks

3 Likes

Hey, I can confirm that the fix for this issue is heading out in 5.5.1p1.

Thanks for your patience!

1 Like

@richardkettlewell When are you going to release 5.5.1p1? The last patch version is 5.5.0p4 now.

We hope to release it this week, but it’s never certain - it depends if QA find anything awful in it :slight_smile:

5.6.6 again

I think this problem happens again in Unity 2018.4. Would Unity developers please take a look ?

Thank you so much.

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 :slight_smile: