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 Harlan · Oct 10, 2012 at 11:21 AM · iosframerateprofiling

iOS framerate drops every 10 seconds or so...

I have an extremely simple project - 1 directional light, 1 cube with Default-Diffuse material on it and 1 camera. Camera points at cube and cube has the following script on it:

     void Update () {
         transform.Rotate(0, Time.deltaTime*10, Time.deltaTime*20); 
     }

That's all there is to it... Deploying to iOS, I get a nicely spinning cube as expected... But every 10 seconds or so, it gets choppy - skipping a handful of frames. Since there is almost nothing going on, I am guessing that either there are background processes in Unity messing things up or the OS itself is doing something that prevents smooth consistent animation.

Here is the relevant profiler output...

 ----------------------------------------
 iPhone Unity internal profiler stats:
 cpu-player>    min:  1.1   max:  2.9   avg:  1.4
 cpu-ogles-drv> min:  0.1   max:  0.3   avg:  0.1
 frametime>     min: 27.3   max: 38.4   avg: 33.4
 draw-call #>   min:   1    max:   1    avg:   1     | batched:     0
 tris #>        min:    12  max:    12  avg:    12   | batched:     0
 verts #>       min:    24  max:    24  avg:    24   | batched:     0
 player-detail> physx:  0.4 animation:  0.0 culling  0.0 skinning:  0.0 batching:  0.0 render: -1.0 fixed-update-count: 1 .. 2
 mono-scripts>  update:  0.1   fixedUpdate:  0.0 coroutines:  0.0 
 mono-memory>   used heap: 188416 allocated heap: 200704  max number of collections: 0 collection total duration:  0.0
 ----------------------------------------
 iPhone Unity internal profiler stats:
 cpu-player>    min:  1.2   max:  3.8   avg:  1.5
 cpu-ogles-drv> min:  0.1   max:  0.6   avg:  0.1
 frametime>     min: 26.3   max: 207.8   avg: 38.9
 draw-call #>   min:   1    max:   1    avg:   1     | batched:     0
 tris #>        min:    12  max:    12  avg:    12   | batched:     0
 verts #>       min:    24  max:    24  avg:    24   | batched:     0
 player-detail> physx:  0.4 animation:  0.0 culling  0.0 skinning:  0.0 batching:  0.0 render: -0.9 fixed-update-count: 1 .. 10
 mono-scripts>  update:  0.1   fixedUpdate:  0.0 coroutines:  0.0 
 mono-memory>   used heap: 188416 allocated heap: 200704  max number of collections: 0 collection total duration:  0.0
 ----------------------------------------
 iPhone Unity internal profiler stats:
 cpu-player>    min:  1.2   max:  2.9   avg:  1.5
 cpu-ogles-drv> min:  0.1   max:  0.1   avg:  0.1
 frametime>     min: 20.0   max: 138.8   avg: 38.3
 draw-call #>   min:   1    max:   1    avg:   1     | batched:     0
 tris #>        min:    12  max:    12  avg:    12   | batched:     0
 verts #>       min:    24  max:    24  avg:    24   | batched:     0
 player-detail> physx:  0.4 animation:  0.0 culling  0.0 skinning:  0.0 batching:  0.0 render: -0.9 fixed-update-count: 1 .. 7
 mono-scripts>  update:  0.1   fixedUpdate:  0.0 coroutines:  0.0 
 mono-memory>   used heap: 188416 allocated heap: 200704  max number of collections: 0 collection total duration:  0.0
 ----------------------------------------
 iPhone Unity internal profiler stats:
 cpu-player>    min:  1.1   max:  2.3   avg:  1.3
 cpu-ogles-drv> min:  0.1   max:  0.1   avg:  0.1
 frametime>     min: 29.0   max: 38.1   avg: 33.4
 draw-call #>   min:   1    max:   1    avg:   1     | batched:     0
 tris #>        min:    12  max:    12  avg:    12   | batched:     0
 verts #>       min:    24  max:    24  avg:    24   | batched:     0
 player-detail> physx:  0.4 animation:  0.0 culling  0.0 skinning:  0.0 batching:  0.0 render: -1.1 fixed-update-count: 1 .. 2
 mono-scripts>  update:  0.1   fixedUpdate:  0.0 coroutines:  0.0 
 mono-memory>   used heap: 188416 allocated heap: 200704  max number of collections: 0 collection total duration:  0.0
 ----------------------------------------

The first set of stats is what you'd expect, but in the second the frametime max is 207.8 ms - a full 1/5th of a second - a very noticable pause in the animation. The third set of stats again has a slow frame at 138.8 ms. At the fourth, everything is back to normal again and it will continue that way for another 10 seconds or so.

Is everyone else seeing this also? I'm using Unity Pro with Unity iOS (not iOS Pro) deploying to an iPhone 4. I get this even if I reboot the iPhone and ensure no other apps are running. Haven't tried resetting my iPhone to factory defaults yet, but I am hoping that there is indeed something unique to my phone and this is not a real problem.

Thanks for reading - any experience you can share this issue (or lack thereof if you've never seen it) would be appreciated.

Comment
Add comment · Show 2
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 Graham-Dunnett ♦♦ · Oct 11, 2012 at 02:40 PM 0
Share

It's not something that I have seen before. Probably worth trying a different device. $$anonymous$$aybe your phone is running some other application that needs some CPU time.

avatar image Harlan · Oct 12, 2012 at 09:56 PM 0
Share

Yes, that was my thought. Good to hear that you've not seen this. :)

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by hvilela · Oct 11, 2012 at 06:31 PM

My guess it that you are allocating too much, giving too much work to the garbage collector. Could be this the cause of your problem?

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 whydoidoit · Oct 11, 2012 at 06:45 PM 0
Share

GC is very slow on iPhone and Unity GC apparently does not apply generations, it does the lot.

avatar image Harlan · Oct 12, 2012 at 09:55 PM 0
Share

Thanks for the feedback... I'm going to try another device...

There is no allocation whatsoever... The only scripting code in the project is the one line above that rotates the cube. So, the GC should not be doing anything... Nothing is ever created.

Glad to hear that others are not seeing this problem - hopefully it's just my device.

avatar image POLYGAMe · Feb 16, 2014 at 06:39 AM 0
Share

Sorry to bump this but I get the same behaviour, on ALL of my iDevices. Did you ever find a fix? It REALLY kills my game...

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

13 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

Related Questions

Why is there so much GC allocation with GameObject.Activate and Physics2D.SendTriggerContactCallbacks on iOS? 1 Answer

Is iOS hardware always locked at 60hz? 1 Answer

iOS profiling help 0 Answers

iOS VSync always active? 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 2 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