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
1
Question by Trungdv · Jan 14, 2017 at 07:34 AM · fpsperformancecpu usage

CPU usage always high on all types of iphone

My game runs well on Iphone 5. When I use XCode to debug it, i saw:

  - CPU usage: about 90~110%
  - Energy impact: "very high"
  - FPS: 30

Then I tested on Iphone 7 plus, I saw :

  - CPU usage: about 90~110%
  - Energy impact: "very high"
  - FPS: 60

and the device is quite hot. So I think maybe FPS is the cause. Then I set frame rate to 30, and test again in Iphone 7 plus. This is the result:

  - CPU usage: about 90~110%
  - Energy impact: "very high"
  - FPS: 30

As you see, the FPS has changed, but CPU and Energy impact did not change at all, and the device still hot! I did not use network at all, this game is totally local, and it even run well on iphone 5 without a lag! Is this a bug of Unity 5? Can someone tell me why?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Trungdv · Jan 17, 2017 at 07:53 AM

I somehow fixed it by myself. These are the steps:

  • Set FPS to 30 by Application.targetframerate.

  • Force use OpenGLES2 in Player Settings / Other Settings / Graphics APIs

  • Set resolution to half width, half height (only iphone 6 plus, 7 plus) by Screen.SetResolution

  • Force build 64-bit by set "Scripting backend" to IL2CPP and Architecture to ARM64 in Player Settings / Other Settings / Configuration

=========================================================

After these configs, I tested on my Iphone 7 plus and this is the result:

  • CPU usage reduce (from 90~110%) to 50~80%

  • Energy impact is still "very high" but it also decreased a bit

  • Overheat: before these steps, device got extremely hot after 10 minutes of play. Now it just become warm a bit after 40 minutes of play.

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 Andrew_unity · Aug 23, 2017 at 06:28 PM

I'm getting high CPU usage too around 40-80% at 60FPS. I want to run the game at 60 because the animations are smoother but the idle CPU usage is really high.

I experimented with putting the Application.targetframerate down to 1 when the game was idle and it drops the CPU usage down to 5%, which is what I'd expect the idle to be at any frame rate. I would then increase it back to 60FPS when someone interacted with the game. It doesn't change fast enough though so it stutters for a couple of frames before reaching 60 again.

I don't see why Unity needs to be doing anything except checking for inputs when apps are idle. 50% CPU is a crazy amount to be wasting. It's half of one of the cores so not 50% of the whole device but still really bad for idling.

When I check the FPS profile in XCode, my frame times are CPU: 16ms, GPU: 3ms so it looks like something is working the CPU far more than the GPU but I can't see what's doing it. When I try to debug the code using Instruments, I get this error:

Instruments: Unable to unarchive payload for < DTXMessage 0x7fec0e3c7e30 : i383.0 c9f object:((null))nil >: ** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (DTKTraceTapMessage) for key (root); the class may be defined in source code or a library that is not linked

In Unity's profiler, it says that WaitForTargetFPS is using the most CPU, which is a VSync thing but I get the same CPU usage on iOS even disabling VSync in the quality panel. I still wouldn't expect the CPU to be doing this for VSync because the GPU frame time is 3ms so there's nothing the CPU has to wait for.

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 Andrew_unity · Aug 23, 2017 at 06:54 PM 0
Share

I found a feedback topic about this with a lot of votes:

https://feedback.unity3d.com/suggestions/manually-activated-render-loop-for-lower-power-consumption-on-mobile

It shouldn't be necessary to have a manual render loop though. Unity just needs to have a more optimal idle state. It's wasting CPU power while drawing no changes. It should only render tiles that need updated. and then stop.

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

89 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 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

Render Transparent Geometry takes high CPU and low fps 1 Answer

Problem with the performance when activating gameObject 0 Answers

SphereCast againt Terrain collider 0 Answers

After 3-5 seconds overhead spikes and keeps taking up +60% of performance 2 Answers

Sprites performance issue 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