Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Android profiler: CPU usage becomes more and more over time? (Please help)

Discussion in 'Android' started by roseportalgames, Jul 12, 2018 at 4:48 PM.

  1. roseportalgames

    roseportalgames

    Joined:
    Aug 9, 2017
    Posts:
    16
    Hey guys,

    I have a 3D "flappy bird" style game.

    The entire scenery is rendered at the beginning and I Destroy() them when they leave the screen on the left (in an effort to decrease lag).

    3D Characters are Instantiated during play but also Destroy()ed when they leave the screen on the left.

    However, checking the Profile at 5 seconds and 1 minute, CPU usage is doubled! I don't understand, it's almost as if what has been shown on screen keeps getting rendered even after it leaves the screen or is destroyed? I really don't know...

    Profiles pictures BEFORE and AFTER:

    https://imgur.com/a/QfRkSc2

    Start:

    End:
     
  2. StuartRiffleUnity

    StuartRiffleUnity

    Unity Technologies

    Joined:
    May 4, 2017
    Posts:
    7
    Just a guess, but maybe thermal throttling has slowed down the device?
     
  3. roseportalgames

    roseportalgames

    Joined:
    Aug 9, 2017
    Posts:
    16
    Can I do anything about that? The device is pretty good LG v20, and I use it for nothing else
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    4,733
    You can:
    1.Optimise as much as you can.
    2.Maybe limit to 30fps?

    It seems that these days in order to be able to run a game consistently, it should be optimised to be able to run at double the framerate that it's actually running. So if you're barely hitting 60, eventually it will throttle.
     
  5. FlashMuller

    FlashMuller

    Joined:
    Sep 25, 2013
    Posts:
    177
    Start by Pooling instead of destroying your elements.
     
  6. roseportalgames

    roseportalgames

    Joined:
    Aug 9, 2017
    Posts:
    16
    Doesn't 30 FPS look bad on a cell phone? I feel like when I hit 30 FPS consistently it looks terrible compared to other games on my phone, all the others seem to run at 60 FPS. Maybe I'm mistaken.
    Is that appropriate for the 3D characters as well? And for example Coins you can pick up?
     
  7. FlashMuller

    FlashMuller

    Joined:
    Sep 25, 2013
    Posts:
    177
    It is appopriate for every object that is used often. With coins: Yes. With 3d Characters... as long as memory isn't an issue with your app and you are regularly spawning them, why not?