Search Unity

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

Discussion in 'Android' started by roseportalgames, Jul 12, 2018.

  1. roseportalgames

    roseportalgames

    Joined:
    Aug 9, 2017
    Posts:
    173
    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:
    10
    Just a guess, but maybe thermal throttling has slowed down the device?
     
  3. roseportalgames

    roseportalgames

    Joined:
    Aug 9, 2017
    Posts:
    173
    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:
    11,791
    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:
    451
    Start by Pooling instead of destroying your elements.
     
  6. roseportalgames

    roseportalgames

    Joined:
    Aug 9, 2017
    Posts:
    173
    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:
    451
    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?