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 JakeT · Mar 04, 2012 at 02:03 AM · iostexturesmemorycrashes

App Crashing on iPhone due to Texture Memory

I've got about 1000 textures in my app, a few hundred of which are active / loaded at a given time. The app I'm running runs ok on an iPhone 4S and the iPad (first gen), but crashes with memory warnings and then app crashes on initial load on the older iOS devices (iPod 2nd gen, iPhone 3, etc.).

I've run the app on the device with the Unity Profiler, but that only tells me the total memory used (41.2MB including 20.9 in Textures and 16.3 in Meshes). It won't tell me which textures are taking up the most space.

I'm trying to find all of the active textures and the memory they're using. Here is the code I've tried:

 #if ENABLE_PROFILER
         var textures = Resources.FindObjectsOfTypeAll(typeof(Texture2D));
         for (var t : Texture2D in textures) 
         {
             Debug.Log("Texture object " + t.name + t.width + "x" + t.height + " (" + t.format + ") using: " + Profiler.GetRuntimeMemorySize(t) + "Bytes");
         }
 #endif

This finds all of the textures being used in Unity Editor (Game mode), including all of Unity's assets which doesnt really help me. And, this code won't build to the device because GetRuntimeMemorySize doesn't seem to be accessible on the device. Here's the error:

Assets/Scripts/mainmenugui.js(1121,123): BCE0019: 'GetRuntimeMemorySize' is not a member of 'UnityEngine.Profiler'.

Any ideas on how I can get a full readout of all of the active / in use textures and their memory usage on the device while it's running? Also, not sure how to output to the console in XCode.

Any ideas??

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 Mantas-Puida · Apr 19, 2012 at 01:07 PM 0
Share

"Assets/Scripts/mainmenugui.js(1121,123): BCE0019: 'GetRuntime$$anonymous$$emorySize' is not a member of 'UnityEngine.Profiler'." was fixed in Unity 3.5.1.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by helios · Apr 19, 2012 at 02:13 PM

I don't know how helpful it would be, but have you checked out the Editor Log?

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
avatar image
0

Answer by JakeT · Apr 22, 2012 at 02:50 AM

Thanks Helios. I did check the Editor Log and it helped a bit. It showed me everything that's loaded in the editor and from there I guessed at what was running on the device. I didn't realize that some fonts take up a ton of memory and it helped me find some other textures that were eating up space.

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

7 People are following this question.

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

Related Questions

Textures suddenly failing to load on iOS during long session 0 Answers

Some textures don't load on iOS 0 Answers

How does masterTextureLimit affect asset load? 1 Answer

How to have 2 sets of textures and make sure only one is loaded? 0 Answers

Memory footprint worries - Web/Standalone vs iOS 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