Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Possible memory leak - Unity 2017 on Mac

Discussion in 'Editor & General Support' started by rodeowild, Aug 3, 2017.

  1. rodeowild

    rodeowild

    Joined:
    Dec 24, 2012
    Posts:
    19
    I've recently come across an issue that is extremely puzzling (and really a project stopper). Basically, When I press play in the editor, and then press stop, unity eats up a bit of my memory, and refuses to give it back (I discovered this when my mac kept running out of memory). In my main project, it eats about half a gig on every iteration (Obviously a real problem). I started removing code and objects from my project, to no avail. Eventually I just started a new empty project (even removing the camera and the light), and lo and behold, same problem. Not half a gig (more on the order 20 meg), but still a leak. I don't know what this could be. Here are some facts to note:

    • I recently upgraded to Unity 2017

    • I'm working on a macbook pro with 16 GB memory

    • In the activity monitor, the total memory used goes up on every iteration of play/stop, but the Unity process memory does not. In fact, I can't find the process using the extra memory.

    • I frequently have multiple instances of Unity running, and communicating with each other via UNET. However, the empty project running with no other instances open still leaked.

    • When I put the computer to sleep, one of two things will happen: either a unity instance will crash, or a significant amount of memory will be freed up (approximately half of the memory eaten up by starting and stopping unity)

    • I tried running an empty project in Unity 5.6 with an eye on the activity monitor "Memory used". The same small incremental memory increases occurred - about 20 MB per start and stop in the editor.
    Does anybody have any idea what this could be? Has anyone experienced something similar? If this is a Unity bug how would I go about informing the correct people / avoiding the problem? If I did something wrong, what should I change?
     
  2. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Dont think they wish to tackle the challenge as it will be a complex and dirty one...
    I'm use to Unity killing everything on my MAC, has been happening for a while..
    Actually 2017 is worse when upgrading and converting projects..

    Try and file a bug report to them...
     
    Shushustorm and rodeowild like this.
  3. rodeowild

    rodeowild

    Joined:
    Dec 24, 2012
    Posts:
    19
    I'm actually hoping the problem is a unity-mac interaction issue, because then the simple solution is to switch to a windows computer. I'm in the process of testing this and I'll let you know how it goes.

    I did post a bug report on when my empty project crashed, but they couldn't reproduce the issue (I'll keep bugging them).
     
  4. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    336
    I've been having similar issues on my Mac. I had similar issues back in 5.6, but it has gotten much worse with 2017.

    Maybe unrelated, but I also deal with frequent crashes due to an unhandled null exception (the actual stack trace isn't provided in Unity's logs). Honestly, I've just accepted the crashes as part of my workflow atm, since I don't have the time to properly fill out a bug report with a reproducible example.
     
  5. jjaine

    jjaine

    Joined:
    Oct 27, 2016
    Posts:
    3
    I'm having this too... Sticking around here if someone has any solutions, because this is really annoying. Which version are you using btw? I've got Unity Pro.
     
  6. system-idle

    system-idle

    Joined:
    Dec 13, 2013
    Posts:
    26
    Same issue here...
    Been using Unity 5.6.2.p2 for a project and kept getting system out of memory popups on 16G RAM Macbook pro, Sierra 10.12.6.
    Started checking Activity Monitor and noticed same issue as described by rodeowild
     
  7. Milo_del_mal

    Milo_del_mal

    Joined:
    Jan 27, 2013
    Posts:
    43
    I am having the same issue, I just updated to 2017 yesterday. Any fixes?
     
  8. ADNCG

    ADNCG

    Joined:
    Jun 9, 2014
    Posts:
    990
    +1 for 2017 leaks on mac. Any updates?
     
  9. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    Same here. I am going back to 5.4.2p2.
     
  10. madbeagle

    madbeagle

    Joined:
    Jan 16, 2014
    Posts:
    10
    +1. Huge memory leaks with Unity 2017. Open Unity, 12GB free, do some light editing in a small scene with just a few UI elements and some cubes, and within 20 minutes I'm down to 1GB free and OSX keeps pausing Unity. Quit Unity, immediate jump back to 12GB.
     
  11. SaltwaterAssembly

    SaltwaterAssembly

    Joined:
    Mar 8, 2016
    Posts:
    95
    +1 Becoming a real project-blocker. Anyone received any responses from Unity on this?
     
  12. kickRole

    kickRole

    Joined:
    Nov 8, 2012
    Posts:
    1
    Adding to the pile here. Running 2017.1 on Macbook Pro (mid 2015, 16 gig or memory), maxOS Sierra.

    I actually had an older Macbook running Photoshop and Unity (5.5.4) with no problem at all, but now after a couple of hours of work, the Macbook will start to pause both Photoshop and Unity because I'm out of memory. And I'm working on a small game, so I'm not stressing either application.
     
    SaltwaterAssembly likes this.
  13. LilyMcCheddar

    LilyMcCheddar

    Joined:
    Feb 4, 2017
    Posts:
    10
    I'm experiencing the same issue, and I'm not even running a big scene either. I am running my project on a Macbook Pro with 16gb of ram and Unity alone is often using up to 12 gb.. Just doing some light debugging on a small scene and the app keeps crashing my computer. I usually don't even have time to close the app before it freezes everything so I'm often force to force-shut my computer. I didn't think it was related to the 2017 update but I guess it is.. What are our options ? Go back a version ? Work on Windows ?
     
  14. Ozer_Jigme

    Ozer_Jigme

    Joined:
    Nov 2, 2016
    Posts:
    12
    + 1

    Working on MacBook Air (13-inch, Early 2015)
    4 GB 1600 MHz DDR3

    Never had a problem before upgrading to 2017. Safest bet at the moment is regularly restarting Unity.
     
  15. umutdemahmut

    umutdemahmut

    Joined:
    Jun 3, 2019
    Posts:
    2
    Hey, I'm really new to Unity. I seem to be getting the same issue with a level I'm creating. I've made many instances of a TV with video and sound playing in a desert landscape. When loading Unity I get the 'No System Memory Left' message and unless I force quite Unity, it crashes my entire iMac!

    Has anyone found a fix to the above? I'm running the latest version of Unity.