• 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 GrandMasterHsu · Mar 03, 2013 at 06:41 AM · iostexturecrashesvram

iOS game Crashes

I'm in the middle of developing a 2D gallery shooter game with a stationary background with targets coming out from all directions for players to tap and shot at. So i made one scene which can take care of all the levels with a code that would load in the appropriate background and targets depending on which level the user is on. So far everything runs perfectly in the unity editor but when i build it into my itouch/iphone the game would crash when i try to start up the actual game play scene. the menu screens works just fine.

i did some searching online to see what could be the issue. first problem i found was that some of the images i have are too large, originally i had Atlases up to the size of 4096x4096 which i found out wasn't supported on devices, so i dropped everything down to a maximum of 2048x2048 afterwards the game still crashes.

next i found this http://answers.unity3d.com/questions/254984/my-mobile-game-crashes-once-a-certain-number-of-te.html question which talked about how there were too much objects loaded into memory so i made changes to objects so i use Resources.Load() instead to prevent too much RAM usage on startup but this didn't solve the issue either.

I've also wondered if anything from the previous scene was still in memory so i used the following to load the scene

 Application.LoadLevel("empty");
 Application.LoadLevelAdditive("TestGameScene");
 Resources.UnloadUnusedAssets();

and lastly this was what i got from the Profiler(Memory) while running in the editor.

 Total: 379.1 MB Delta: 0 B
 Textures: 307 / 43.9 MB
 Meshes: 238 / 0.5 MB
 Materials: 88 / 26.7 KB
 AnimaitonClips: 0 / 0 B
 AudioClips: 26 / 5.9 MB
 Assets: 3171
 GameObjects in Scene: 132
 Total Objects in Scene: 1018
 Total Object Count: 4189

I'm really stuck and not sure on how to fix the issue i have at hand where the game crashes. Any idea or advice would be greatly appreciated.

Comment
Add comment · Show 6
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 steakpinball · Mar 03, 2013 at 08:30 PM 0
Share

The Instruments tool in Xcode can monitor memory usage of your iOS device. Run your game through it to see if memory usage is a problem.

avatar image Graham-Dunnett ♦♦ · Mar 03, 2013 at 09:12 PM 0
Share

and look to see what gets written to the console log in XCode. If the app is crashing or getting killed, XCode should know something about it. Post the console log here if you need help understanding it.

avatar image GrandMasterHsu · Mar 03, 2013 at 10:50 PM 0
Share

okay i ran the Activity $$anonymous$$onitor and found out that my game is using 69.9% of the CPU, 134.53$$anonymous$$B of real memory, and 314.72$$anonymous$$B of virtual ram.. oh boy

avatar image GrandMasterHsu · Mar 03, 2013 at 10:52 PM 0
Share

am i having memory leak somewhere? or is the textures im using too large still?

avatar image Graham-Dunnett ♦♦ · Mar 04, 2013 at 11:39 AM 0
Share

I can't tell you whether you have a memory leak. That's something you'll need to work out. The built in Profiler can help you with that: http://docs.unity3d.com/Documentation/$$anonymous$$anual/iphone-InternalProfiler.html. Also, try making all your textures 64x64 pixels. Obviously the game will look rubbish, but if it runs without crashing, you know you have a texture problem.

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

11 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

Related Questions

Download images from url, save to device, load into UGUI 4 Answers

Images not importing when platform is ios? 0 Answers

My ios Project is too big!?what can i do? 1 Answer

Texture on instantiated asset bundle sometimes black only on iPhone 0 Answers

Show 3d object on device live camera in Unity3d for 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