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
0
Question by Aladine · Jan 10, 2016 at 03:49 AM · animationiosperformancememory management

IOS Terminated due to memory issue because of a 2D animation with 60 frames in it

Hi everyone, A strange thing start happening last night, am working on [this game]() (we have more stuff now) and everything was working fine on my side (galaxy s5 and s3) but when i send the project to my client to test it on his iphone5, the game crash and log this error :

 Message from debugger: Terminated due to memory issue

it was caused by a single Animation, it contain 60 Frames with a different image for each frame, and each image has a resolution of 480x480. We changed that Animation on iOS (removed 57 frame) and we no longer get the error.

The question is, why is that happening ??? The exact same game with that "big" animation is running okay on a Galaxy s3 and Galaxy s5, what make this an exception for iOS ?

Thanks

[unity 5.1.3]

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by phil_me_up · Jan 10, 2016 at 01:26 PM

Are all 60 frames a different 480x480 image? If so then that is a lot of memory needed to display them all, even if you are using optimal compression. Remember that if the file size of a jpeg / png etc is something like 150kb, that's not what it uses in memory on device, it will use significantly more as it will be uncompressed.

The Galaxy S3 and iPhone 5 both have (i think) 1Gb ram in in, how that ram gets used depends on the OS and on what is running in the background. That would explain the differences between platforms (also your image compression might be different between platforms).

Bottom line, when developing for mobile you need to be very conscious of your images. Some optimization tips are to try and make them PowerOfTwo and improve compression (PVR for example), or to pack sprites in one or more sheets which you then setup to use better compression.

Comment
Add comment · Show 3 · 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 Aladine · Jan 10, 2016 at 05:19 PM 0
Share

I see ...

We did had a spritesheet for this animation but no matter what we do, the edges are always blurry.

atm i am thinking of using a render texture, or divide the animation in 4 parts or something

Thanks

avatar image phil_me_up Aladine · Jan 10, 2016 at 06:34 PM 0
Share

I'm not sure either of those solutions would work as you'll still basically be loading in the same assets which will use the same memory. Perhaps you'll find a configuration which improves matters, but remember that there are people out there with devices that have 512$$anonymous$$b and less.

I would look at what you're actually trying to do. Does the animation need to swap between 60 different sprites, or could each frame consist of common parts which are simply re-positioned / re-coloured etc to make the whole? Think of a playing card, you don't need 52 individual sprites to make any card in a deck, just the suits, the numbers and then perhaps a couple of special cases for kings / queens etc.

Does the sprite need to be 480x480?

Depending on how frequently you need to change the sprites, you may be able to unload the assets, but you don't want to be doing this too often as it'll probably cause some stutter.

avatar image Aladine phil_me_up · Jan 10, 2016 at 07:14 PM 0
Share

This is the animation i will look if we can reduce the sprites resolution, but tonight am gonna give GAF a try, since all of our art is made in Flash, i think this could be the perfect tool.

thanks

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

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

Related Questions

Adding animation clips via script 2 Answers

Profiler does not show objects when hooked to an iPad 1 Answer

Keyboard triggered animation not showing on IOS device 0 Answers

Android Tablet vs iOS iPad performance difference 0 Answers

Animation of terrain causes drastic performance drop (fps) 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