Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by rodeowild · Aug 01, 2017 at 04:26 PM · unityeditormemory-leakmemory usage

Unity Editor Memory Leak

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)

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?

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image rodeowild · Aug 04, 2017 at 12:58 AM 0
Share

I switched to a PC and that seems to have solved my problems for now.

avatar image MattAnderson · Sep 06, 2017 at 05:09 PM 0
Share

We are experiencing a massive memory leak issue -- it frequently crashes both of our development PCs and seems to be particle related. Right before the comps go down they get an Assertion Failed in console, and the following crash usually requires a hard reset. It happens in editor when viewing particle effects, even when the game is not running. Builds of the game work fine. We can't work on our project for more than 20 $$anonymous$$utes at a time, and when at full clip, Unity eats up 100 megs of memory a second.

Please get this fixed asap. This is absolutely ridiculous that this type of error made it out the door in core release.

avatar image brc51 · Sep 20, 2017 at 03:28 PM 0
Share

Same issue with a large memory leak when updated to 2017 (free version). Gigs of memory in a few $$anonymous$$utes.

4 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by PNUMIA-Rob · Aug 09, 2017 at 02:25 AM

We are also experiencing is (or a very similar) issue after updating to Unity 2017 when programmatically setting the effectColor property of a Outline/Shadow component.

 GetComponent<Outline>().effectColor = Color.black;

With 20 items doing this on a regular basis, several gigs of RAM is eaten up in a matter of minutes and a full OOM error and possible device crash eventually always occurs.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image PNUMIA-Rob · Sep 06, 2017 at 09:34 PM 1
Share

Update:

Not sure this is anyone else's issue, but ours ended up being that one of the $$anonymous$$m members had set Build Settings -> Other Settings -> Scripting Runtime Version to Experimental (.NET 4.6 Equivalent) and forgot to disable it before committing. Switching it back to Stable (.NET 3.5 Equivalent) plugged the leaks.

Hope this helps someone.

Cheers!

avatar image
0

Answer by LocalNoob · Aug 01, 2017 at 04:54 PM

Check out a memory tab in profiler

Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image rodeowild · Aug 01, 2017 at 05:03 PM 0
Share

Unfortunately, I have the free version of unity, so the profiler is unavailable to me.

avatar image LocalNoob rodeowild · Aug 01, 2017 at 07:15 PM 0
Share

At the top panel go to window-profiler. I also got a free version and it is available

avatar image rodeowild LocalNoob · Aug 01, 2017 at 07:42 PM 0
Share

Ok, I can bring it up but I'm not sure how to interpret it. It runs even when not in play mode (as expected). Right now I'm using 13.3 GB out of 16 GB with one unity instance running. What information should I be trying to obtain from the profiler?

Show more comments
avatar image
0

Answer by x4637x · Aug 04, 2017 at 06:28 AM

I also have the same problem currently, but I am using both Windows and Linux. Wired thing is Unity running on Linux perfectly fine (no leak), only Windows have this issue.

What I been trying to solve this is find out detail memory usage in unity profiler, so far I am using profiler like this :

  1. Open Profiler disable "Record" and enable "Profile Editor" (also clear sample data if there is any).

  2. Open up editor windows that I normally use.

  3. Hit "Record" button and start taking sample. (keep an eye on your memory, those sample data could take a lot of your memory)

  4. End "Record" before memory ran out.

  5. Close all unity window but the profiler.

  6. Select a frame on Memory section and change mode from "Simple" to "Detailed".

  7. After in "Detailed" mode, click "Take sample : Editor".

The last step is the close I can get to the source right now, still trying to work out what is the cause from there. I hope this information is useful for your debugging as well.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image rodeowild · Aug 04, 2017 at 03:54 PM 0
Share

So far I'm not having an issue on windows, but I've only been using it for a day. I'll let you know if that changes.

avatar image x4637x · Sep 07, 2017 at 03:39 AM 0
Share

Update : We've fixed our leak. It's cause by our own editor code, one of our editor tool create lots of Icon Texture2D during Update. Fixing that have stop the leaking. We figured this out by looking into Unity profiler and noticed GUIRepaintAll() is taking too much resources. Also Texture count in memory is increasing way too fast. If anyone having trouble looking into profiler data at the same project, I suggest you save your profiler recorded data to somewhere first, then load it in an empty project and then analysis it there.

avatar image
0

Answer by ralphyua_unity · Sep 30, 2017 at 02:47 AM

When is Unity going to fix this? Having the same problem where Unity will crash after running out of memory. This didn't happen until I upgraded to the latest release of Unity. I can only work for about twenty minutes before I have to restart again. It's a real pain in the butt. I try to save after every little change knowing that the clock is ticking and that the memory could be used up at any time. When I open a new project, Unity then deallocates the memory, but that doesn't really solve anything. Quitting and restarting Unity is better than going into a new project then the original project again.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · Sep 30, 2017 at 02:58 AM 1
Share

This is not an answer. This is a Q&A site. One question at the top and answers which answer the question below. If you can't answer the question, don't post an answer. You can post a comment if you think you actually have to say something new. If not please don't bump threads for no reason. Unity staff won't read the questions here. If you want to file a bug report you should do that from within Unity.

However first make sure you actually read all the information available here. Especially "LucidAmusement" answer and his comment on his answer. So make sure you don't use the "Experimental" backend.

ps: You haven't mentioned which exact version you're using "latest release" can be interpreted in many ways as Unity has an official stable release, temporary patch releases and beta / experimental releases.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

77 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Memory Leak in Play Mode 1 Answer

Is this memory usage too much for a mobile game? 1 Answer

iOS crash problem: Received memory warning . How to solve that? 1 Answer

Question About Camera's, Canvases and Memory 0 Answers

"Real Memory" usage in iOS expands the more often one prefab is referenced in the assetbundle 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges