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 Jason-H · Jun 28, 2011 at 09:01 PM · frameratefixedupdateconsole

How do I find out what is using Fixed Update (and slowing the frame rate to around 5fps every 10 seconds or so)

Hi everyone,

I noticed every 10 seconds or so the frame rate of my game slows dramatically. I've used the Xcode console and I've worked out that it's due to the fixed updates as this is the only thing that is different.

Normally there are 3-5 each time the console takes a reading from the device although when it slows it counts 15-20.

How can I find out where these Fixed updates are being used? I believe I only have a single fixed update function in one of my scripts (for the main character) - nowhere else, so what else could be using it? Does another function use Fixed update?

Or do you have any other suggestions?

Thanks!

EDIT: Here is the output of the Console in Xcode for one of the times where it slowed down a lot. If it's not the Fixed Update that's slowing everything down then does that mean it's the physx? As that's quite high. Although during the time that this reading occured I don't believe there would have been any more calculations for the Physx as I was doing exactly the same thing as normal in the game. (No special buttons were pressed, or abnormal animations on screen etc..)


iPhone Unity internal profiler stats:

cpu-player> min: 47.2 max: 513.7 avg: 105.8

cpu-ogles-drv> min: 1.9 max: 8.3 avg: 2.5

cpu-waits-gpu> min: 0.2 max: 0.8 avg: 0.2

msaa-resolve> min: 0.0 max: 0.0 avg: 0.0

cpu-present> min: 0.8 max: 11.6 avg: 1.5

frametime> min: 57.7 max: 526.9 avg: 113.5

draw-call #> min: 42 max: 46 avg: 43 | batched: 1

tris #> min: 10067 max: 12326 avg: 11095 | batched: 126

verts #> min: 5065 max: 6219 avg: 5605 | batched: 86

player-detail> physx: 62.9 animation: 14.9 culling 0.0 skinning: 1.3 batching: 0.0 render: 6.5 fixed-update-count: 3 .. 25

mono-scripts> update: 13.8 fixedUpdate: 2.2 coroutines: 0.1

mono-memory> used heap: 610304 allocated heap: 2387968 max number of collections: 0 collection total duration: 0.0


This can be compared to the normal reading (and frame rate) I get the majority of the time which gives the following as output from Xcode.


iPhone Unity internal profiler stats:

cpu-player> min: 47.8 max: 73.7 avg: 57.2

cpu-ogles-drv> min: 1.9 max: 9.2 avg: 2.6

cpu-waits-gpu> min: 0.2 max: 0.3 avg: 0.2

msaa-resolve> min: 0.0 max: 0.0 avg: 0.0

cpu-present> min: 0.9 max: 6.7 avg: 1.3

frametime> min: 54.9 max: 87.0 avg: 65.0

draw-call #> min: 41 max: 44 avg: 42 | batched: 0

tris #> min: 7899 max: 10847 avg: 9340 | batched: 0

verts #> min: 4009 max: 5433 avg: 4711 | batched: 0

player-detail> physx: 33.2 animation: 5.3 culling 0.0 skinning: 1.2 batching: 0.0 render: 5.9 fixed-update-count: 3 .. 4

mono-scripts> update: 8.8 fixedUpdate: 1.1 coroutines: 0.0

mono-memory> used heap: 716800 allocated heap: 2387968 max number of collections: 0 collection total duration: 0.0


You can see that of the two readings, the one that really slows on the device as a greater 'cpu-player' max, higher FixedUpdate count as well as Physx and animation values.

Perhaps it's something to do with the CPU? If so, would that only be possibly affected by the scripts running and therefore I need to look there?

Thanks in advance for any light you can shed on this!

Unity Forums thread on same issue; http://forum.unity3d.com/threads/94829-What-is-slowing-my-game-to-5fps-every-10-seconds-or-so-(Console-log-attached)

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 Dreamblur · Jun 28, 2011 at 09:23 PM 2
Share

No, no, no, no, no. You've got it wrong. Just no.

You're mistaking the effect for the cause. FixedUpdate() runs after every interval of Time.fixedDeltaTime, which is set to 0.02 seconds by default. Now, if your frame rate is low, that means FixedUpdate() will run more times per second than the number of frames. Now, I don't know what is running in your FixedUpdate() methods, so maybe you are running some funky code in there that may cause some slowdown. But from what you're describing, I see no reason to think that way.

Imagine a train passing by every 10 $$anonymous$$utes, and another train that passes by at weird intervals. The 10-$$anonymous$$ute train is FixedUpdate() and the other train is the frame rate. Now, if the other train is passing by at intervals that are on average almost constant, then the 10-$$anonymous$$ute train will seem to be in sync with it. But if the other train suddenly slows down and starts passing by every 100 $$anonymous$$utes, then the 10-$$anonymous$$ute train will pass by more often even though nothing about it has changed. That's what's happening with your frame rate and FixedUpdate().

avatar image Jason-H · Jun 29, 2011 at 11:29 AM 0
Share

Ok I understand that now. Thanks for the help. Could you look at the edited question now and see if you know any other possible reason it may be slowing dramatically? Cheers.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by DaveA · Jun 28, 2011 at 11:24 PM

Do you have any processes timed to go about every 10 seconds? Like polling a server? (LateUpdate or Update or otherwise). If not, sounds like it's probably doing garbage collection. You might want to make sure you aren't leaking stuff. Make sure you destroy things that are no longer used. That kind of thing.

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 Waz · Jun 29, 2011 at 12:02 AM 0
Share

How does using Destroy avoid Garbage collection? If anything, it makes it worse.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Frame dependant game. Using update vs fixed update. 3 Answers

Getting Input every few frames? 2 Answers

trying to regulate character speed. 1 Answer

Physics behaviour changing with framerate - Is FixedUpdate() actually working properly? 3 Answers

Unity Physics frame rate. void FixedUpdate 3 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