• 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 t$$anonymous$$s 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 t$$anonymous$$s 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 t$$anonymous$$ngs 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 t$$anonymous$$s could be? Has anyone experienced somet$$anonymous$$ng similar? If t$$anonymous$$s is a Unity bug how would I go about informing the correct people / avoiding the problem? If I did somet$$anonymous$$ng 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
avatar image MattAnderson · Sep 06, 2017 at 05:09 PM 0
Share
avatar image brc51 · Sep 20, 2017 at 03:28 PM 0
Share

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 t$$anonymous$$s 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
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
avatar image LocalNoob rodeowild · Aug 01, 2017 at 07:15 PM 0
Share
avatar image rodeowild LocalNoob · Aug 01, 2017 at 07:42 PM 0
Share
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 t$$anonymous$$ng is Unity running on Linux perfectly fine (no leak), only Windows have t$$anonymous$$s issue.

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

  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 t$$anonymous$$s 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
avatar image x4637x · Sep 07, 2017 at 03:39 AM 0
Share
avatar image
0

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

When is Unity going to fix t$$anonymous$$s? Having the same problem where Unity will crash after running out of memory. T$$anonymous$$s 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 anyt$$anonymous$$ng. 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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

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 profiling" Menu missing under windows menu. (5.3.8F1) 0 Answers

Could not allocate memory: System out of memory! MemoryLabel: Animation 0 Answers

Sub-emitter memory leak? 3 Answers

Unity using too much memory on mac 0 Answers

Memory leak for using Emgucv facedetection function. 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