Unity 5 Lighting RAM Problem
I have found that using a light in Unity 5 with any type of shadow causes the Unity editor memory usage to skyrocket. I have tried turning shadows off, and my scene idles happily at about 130 MB of usage. If I turn shadows on, it increases at a rate of around 4 MB/s and doesn't stop until the game becomes unplayable (it got above 1GB total ram usage). Is this a bug in Unity 5? Anyone know how I can resolve this issue?
I am using Unity 5.2.1f1 Personal edition.
Also, the memory usage stays high after I stop play, and doesn't reset when I press play again; it just keeps adding.
Edit: I should mention I am on 64 bit Windows 10. GPU is Nvidia GTX770 using driver 355.83.
Same problem here, on Unity 5.2.1f in Windows 7. Happens in editor and player. As long as there's a light source with shadows enabled, and some objects that cast shadows visible, memory usage keeps climbing.
Does this happen in a simple scene (e.g. a single cube)? Does the rate of memory consumption depend on the complexity of the scene?
Dan
Unity Support
Does this happen in a simple scene (e.g. a single cube)? Yes Does the rate of memory consumption depend on the complexity of the scene? Yes
The memory leak start as soon as receive shadow is activated on mesh
It's easy to see the problem, create an empty scene, add some objects that receive shadows and a directionnel light with shadows. If you disable receive shadow the memory stop increasing.
Not resolve in 5.2.1p1. I've got the same problem. Hope it will be release in next release. There was not problem before 5.2 Tested on 3 differents computer with different graphic card, and I get the same problem
Thanks for your input everyone. We have a bug our database now (734269) (from @Xoduz I believe; thanks!) which hopefully will become visible on issuetracker.unity3d.com after it has been through the full QA process. But we have seen the issue here so this should get some attention now.
Dan
Unity Support
Answer by mikelortega · Oct 21, 2015 at 08:16 AM
You can check the issue ID 736709 in the Unity Issue Tracker:
Memory leak when shadows are turned on
Please, vote on this issue so it gets prioritized. I think it's important, with big scenes this issue becomes quite critical.
Answer by samshoe12 · Mar 25, 2016 at 07:19 PM
I have the same exact problem, but it progresses to the point of the memory spiking to 100%, disk at 100%, and CPU at 98%, which is followed shortly thereafter by the screen not just going dark, but shutting off completely, even though the computer stays on. This cannot be fixed unless you reboot completely, which causes huge problems on startup of my computer.
Which version of Unity are you using? Bug 736709 was fixed in 5.3 and also in 5.2.2p2.
Dan
Unity Support
Your answer
Follow this Question
Related Questions
Cast shadow on ground plane with sky box / VR. 0 Answers
Trees not casting shadows properly 1 Answer
Why Ui/lit shader makes the object go invisible? 1 Answer
Weird shadows when camera is in the right position 0 Answers
Unity3D Lightning/Shadow Bug 0 Answers