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
4
Question by Johannes 1 · Jul 28, 2011 at 03:37 PM · guicrashmemory

Unity crashes when GUI becomes too complex

Hi,

We are experiencing serious problems and crashes when our GUI becomes too complex, both in the editor and the webplayer build. For our ingame GUI, we use a modified GUIX version. This framework basically wraps UnityGui calls in classes that can be instanciated (like a button, a label, etc.). All images and skins that are used in our GUI are stored in the Resources folder and loaded via "Resources.Load", styles for elements are set via "Skin.FindStyle".

Until recently, everything worked fine, except for the known GC performance spikes that come with Unity's OnGui() calls. But now one of our dialogs (a character dialog with inventory, multiple tabs for various attributes, etc.) became slightly more complex, and we are experiencing weird error logs and Unity crashes as soon as this dialog is instanciated. Sometimes we get one or more of the following error log messages in the editor console:

  • srcData == NULL

  • failed to create 2D texture

  • !texture.texture

All of those come without any more details and a callstack that starts somewhere in our GUI code, the last line is always "UnityEngine.Resources:Load(String)" When this happens, the memory goes from 250MB to >1GB and instantly back to ~300MB, and Unity crashes afterwards. Sometimes an editor window pops up with an "Out of memory!" message (again in "UnityEngine.Resources:Load(String)"). Sometimes Unity just quits without any error message, then the following output can be found in the editor log:

Crash!!!

========== Outputing stack ==================

(endless list of dll and drv files, starting with Unity.exe)

(the following a few times:)

  • (Address: 00966FFC) 00966FFC (Unity): (filename not available): (function-name not available) ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.*

========== End of Outputing stack ===========

When we remove a few GUI elements from the complex dialog, this problem vanishes. Oddly, it suffices to remove SOME elements, not specific ones. It is even enough to delete a few elements that contain very small images just 2kb large. Then, at the moment the dialog is instanciated, the memory goes up to 1300MB from 250MB for a few moments, drops back to 300MB, and everything works fine afterwards.

We have tried to following attempts to solve this problem or find the root of it:

  • Adding GC.Collect() Calls after instanciating each dialog (or even inside longer initializations) makes no difference

  • Upgrading our project to Unity 3.4 does not help

  • This problem does not (yet?) occur in the editor in Win7 64bit (only in 32bit), but the webplayer build crashes both in 32 and 64bit systems

  • Reducing the number of Resource.Load() calls does somewhat defer these problems, but they reoccur at a later time, when more dialogs are instanciated.

  • Similar "out of memory" problems in other forum threads all describe problems when importing large assets into the project (not loading assets at runtime) or using memory >2.5GB for assets. But in our case we use only 350MB, with the memory peaking at 1.3GB for a few moments when all textures and skins are loaded?

Is it possible that loading the same texture multiple times with Resources.Load() results in huge memory usage, and this again causes these crashes? I was under the impression that Resources.Load() caches previously loaded assets, so it is not necessary to cache them myself when multiple elements use the same texture.

I am looking forward to any solution or clue, this is a very grave problem for us. We have just implemented a part of the GUI that we are planning to have, and it seems that we already hit some internal unity limit that prevents us from creating more GUI elements.

Best Regards, Johannes

Comment
Add comment · Show 1
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 wgrand · Sep 02, 2011 at 09:45 PM 0
Share

Did you find a solution to this? I'm having memory issues with iOS with Resources.Load(). I don't think I'm loading all that much either

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by swisscoder · Jan 09, 2012 at 11:24 AM

it's a shame that U not got an answer yet. When u make such a detailed bug report, you should at least get an answer from the Unity staff..

Comment
Add comment · 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

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

Crash on Inspector during play 0 Answers

Sprites and minmizing memory usage 1 Answer

Mysterious crash involving an array 2 Answers

Crash During Builds + Recommended Size of Resources Folder 0 Answers

Unity Shutdown 1 Answer


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