Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
10
Question by Boondock_Saint · Nov 09, 2011 at 12:30 PM · editorwebplayermemory-leak

Memory leak gallore

  • Note: I've also openend a topic on the forum about this: http://forum.unity3d.com/threads/111365-Memory-leak-galore **

  • Note2: Please vote! http://feedback.unity3d.com/forums/15792-unity/suggestions/1067023-scripting-garbage-collection-sgen-gc **

At our company we have several projects relying heavily on Unity. We used all the tricks out there (http://answers.unity3d.com/questions/129364/memory-management-tips.html), but somehow when we close our webplayer, one title still has 150 MB and another has 200 MB of unreleased memory (both in Firefox and Chrome). What is worse, is that when you start a new game, without killing the previous plugin container, it simply adds to this memory residue, so it's not a question of caching. The editor too, appears to have this problem.

Now, of course, you can accuse us of bad programming. Sure. We're the worst programmers ever. However, it cannot be that the virtual machine does not release the memory claimed by our games, anno 2011. So my question is twofold:

  • Do other developers recognize any of this?

  • When is Unity3D going to upgrade its version of Mono? (and don't say it's too ingrained in Unity, that's what design patterns are for)

http://tirania.org/blog/archive/2009/Nov-09.html

Sorry for the tone, but something needs to be done, since 3.5, at the moment, doesn't hint at any improvement in this area.

ps: Starting the game again and closing it adds 150 or 200 mb respectively, so the residue increases 150, 300, 450 etc. And remember that users have more than 1 tab open, so machines start swapping rather fast. pps: Another thing we've looked at http://answers.unity3d.com/questions/153050/memory-management-and-list.html

Comment
Add comment · Show 13
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 CHPedersen · Nov 09, 2011 at 12:58 PM 0
Share

I've ranted about this issue on several occasions myself and can only +1 the question. It's hard to answer your question because this board is user driven, and the fellow users don't know what Unity Technology's plans are for $$anonymous$$ono. $$anonymous$$now, though, that I too recognize this, and really badly want a generational garbage collector.

avatar image CHPedersen · Nov 09, 2011 at 01:39 PM 0
Share

Yes, I'm well aware of http://answers.unity3d.com/questions/153050/memory-management-and-list.html :)

I wrote that question.

avatar image Boondock_Saint · Nov 09, 2011 at 01:49 PM 0
Share

LOL :) Sorry, I didn't look at the name. Btw, have you ever encountered the 'Too many heap sections' message, after which Unity crashes?

avatar image CHPedersen · Nov 09, 2011 at 02:03 PM 3
Share

Yes. That's the "standard" message Unity throws at me when it runs out of memory. It makes good sense too - the heap is where all declared variables, global variables, static variables etc is declared (as opposed to the stack, which houses local variables such as those declared within a function or passed as parameters). The stack cannot get fragmented, because memory allocated to it is popped off of it again in the proper order; it obeys the LIFO principle. It's like adding and removing plates in a kitchen cubboard - no holes appear in between plates, because the one most recently added is also the one that will next be taken. That's why it's called "the stack". The heap is different: It obeys no principle that maintains non-fragmentation. When memory is de-allocated and the garbage collector fails to properly defragment the heap, huge holes appear in it, and in the end, the OS refuses to offer up more fresh memory, so Unity is unable to expand its heap. Then it crashes with the "too many heap sections" message.

avatar image Boondock_Saint · Nov 09, 2011 at 02:07 PM 0
Share

Exactly. It's the problem addressed in the blog post by $$anonymous$$iguel de Icaza ($$anonymous$$ono's lead developer at the time). Note how the blog post is from 2009.....

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by ptdnet · Nov 27, 2011 at 05:37 PM

For what it's worth I went to the Mono web site and installed their latest version. It works perfectly with Unity.

Comment
Add comment · Show 10 · 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 Boondock_Saint · Nov 28, 2011 at 08:07 AM 0
Share

That sounds very interesting ptdnet. Do you believe that that version of $$anonymous$$ono is then also used for building a webplayer?

avatar image CHPedersen · Nov 28, 2011 at 08:27 AM 1
Share

I was under the impression the $$anonymous$$ono runtime was somehow kneaded so deeply into Unity that you couldn't just update it yourself manually. Are you certain Unity is actually using what you installed, and not just continuing on with its own?

avatar image Boondock_Saint · Nov 28, 2011 at 08:31 AM 0
Share

Yes, after drinking my first coffee and discussing this with colleagues, we have the same question as Christian. Seems to us that you at least had to exchange some dll in the Unity directory, but from your comment it sounds as if it works 'out of the box'. Can you give us some more specifics? :)

avatar image ptdnet · Nov 28, 2011 at 01:43 PM 0
Share

It's using the only version of $$anonymous$$ono on my computer (v2.8.1). I'm using Snow Leopard.

avatar image CHPedersen · Nov 28, 2011 at 02:18 PM 2
Share

I'm almost 100% you're not running your own installation of mono. Please take a look at these links:

http://answers.unity3d.com/questions/8067/will-installing-a-newer-mono-version-break-unitys.html

http://forum.unity3d.com/threads/42974-Announcing-Unity-3.0!-iPad-Android-and-PlayStation!?p=273374#post273374

And in particular, HiggyB's reply in the forum one. You cannot simply replace Unity's version of $$anonymous$$ono yourself, it's integrated into the system, as explained. What you have installed is running alongside Unity's own version, not ins$$anonymous$$d of Unity's own version, and Unity's version will not change unless Unity Technology decides to change it.

Show more comments

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Build unity application using a unity application. 1 Answer

Problem Loading Asset Bundles on Web Player 1 Answer

Folder for non-editor dll 0 Answers

[SOLVED] Unity 5: Lightmap dissapearing in web player but not in editor 1 Answer

Memory leak on Mac Editor 4.6.x 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