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
0
Question by Hoeloe · Jan 11, 2015 at 09:47 PM · errorbugout of memory

Running out of memory when loading scene (worked perfectly until about an hour ago - no change to scene).

So, I've been getting a rather infuriating error where Unity has started running out of memory when loading my scene. The interesting thing is that this has only just started happening, and the scene being loaded has not changed.

The only difference between this build and a working one is the presence of music playing on the scene previously, which is streaming from the disc and should not significantly alter the memory footprint. The memory usage of the level once loaded is a little over 1GB, but seems to be more than double this while loading (the scene I am loading from is quite light weight). What I also find interesting is that all of the peak values on the error report are 0B, which seems very odd. It also seems odd that none of the "used" values are above the "allocated" ones, which should mean I have some memory left to use. I'm also not running out of memory overall, as my memory usage isn't reaching 100%.

When I remove the music from the scene, the error does not disappear. I am now unable to actually play the game I've made because of this. This is extremely weird, because the content of the game is exactly the same, and it was working perfectly until about an hour ago. Is there anything I can do about this?

Task manager and error message

EDIT: I've found this appears to be related to a Video Player system I've built. Since I'm using Unity Indie, I can't use movie textures, so I constructed my own filetype which allowed me to stream a series of JPG images as textures to display. This seems to occasionally throw an Overflow error, and when it does and is allowed to terminate the script, the game will load. Otherwise, it seems it won't.

unity running out of memory.jpg (149.2 kB)
Comment
Add comment · Show 12
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 Hoeloe · Jan 11, 2015 at 10:22 PM 0
Share

I appear to have fixed this by using an intermediate loading scene, rather than directly loading the level from the previous scene. It looks like it was related to the video player only in that the video player has a high memory footprint. I'll test a bit more, and see what happens.

avatar image AcE_fLoOdEr · Jan 12, 2015 at 12:27 AM 0
Share

If you find the answer, just answer your own question so people can find it easier. :)

avatar image Hoeloe · Jan 12, 2015 at 12:36 AM 0
Share

I usually do. I haven't this time because the error was intermittent, and I'm not certain it's actually been fixed.

avatar image Hoeloe · Jan 14, 2015 at 06:13 PM 0
Share

Nope, this error is still occurring. It's a bit weird. Sometimes I get this error every time I load a level, change something, then it all works, and then the error reappears without me changing anything.

avatar image khos85 · Jan 14, 2015 at 10:33 PM 0
Share

Have you tried to stop all other non essential apps like skype to free up ram, that could help! If Unity has not changed then something else may have and there is lots of other stuff happening on a windows machine at any given time..

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by ricardo_arango · Jan 20, 2015 at 06:59 PM

Just a guess, but if you are creating your own Texture2D objects via script for each frame of video, make sure to Destroy them when you are done using them calling Destroy(). They are automatically destroyed when you change scene (if you are not referencing them statically or by an object marked with DontDestroy), but at that point you may already be using too much memory.

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 Hoeloe · Jan 20, 2015 at 07:31 PM 0
Share

This is exactly what I was just trying. It seems to work, as Unity is now peaking at around 450$$anonymous$$B memory usage rather than 2GB, which is a lot more acceptable.

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

29 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

Related Questions

Invalid location when saving uScript file 0 Answers

Stuck on splash screen android 0 Answers

UnityException: Transform child out of bounds when my AI needs to do its Move 1 Answer

peer certificate cannot be authenticated 0 Answers

After Unity Crash Camera RenderTexture 0 Alpha 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