Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. 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.

  1. roseportalgames

    roseportalgames

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

    roseportalgames

    Joined:
    Aug 9, 2017
    Posts:
    45
    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,979
    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:
    244
    Start by Pooling instead of destroying your elements.
     
  6. roseportalgames

    roseportalgames

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