Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Profiler: 2GB meshes memory usage for little 2D game?

Discussion in 'Editor & General Support' started by zapposh, Aug 30, 2017.

  1. zapposh

    zapposh

    Joined:
    Nov 12, 2016
    Posts:
    94
    Basically, I have a simple 2D platformer with not too much going on.
    What sticks out like a sore thumb in the profiler is the Meshes Memory usage.
    It starts around 1,6GB and can climb to 2GB during the level, in every level.

    Looking at the detail, the culprits seem to be "Shared UI Mesh" elements.
    All there is in the UI are some hearts for lives and a coin counter.

    Is this to be expected for this type of project? (screenshots attached)
    Just making sure...
     

    Attached Files:

  2. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,090
    Profile your exported game.
    To quote a little sentence from your second screenshot:
    "Memory usage in the editor is not as it would be in a player"
    The editor has all the stuff that you have in your project mostly loaded even if the scene does not contain it.
    In the exported game the memory usage should be a lot lower.
     
  3. zapposh

    zapposh

    Joined:
    Nov 12, 2016
    Posts:
    94
    Still a little concerned tough, since if I delete the little UI hierarchy from the scene, the Meshes Memory goes down from 2GB to almost 0 (300KB).

    But I'll try not to worry about it. :)
     
  4. Zenix

    Zenix

    Joined:
    Nov 9, 2009
    Posts:
    207
    Which version of Unity are you using? 2017 has a pretty serious memory leak that was fixed in patch 2.
     
  5. zapposh

    zapposh

    Joined:
    Nov 12, 2016
    Posts:
    94
    Interesting. I'm on 2017.1 p1, so I'll try updating.

    Also, after searching, I found that some users, in older versions of Unity, had major performance issues if their canvas was just a child of a gameobject, or a child of a gameobject not at (0,0,0), or if the parent was animated.

    While my parent was reset and not animated, moving the canvas directly to the root of the scene reduces the Meshes Memory from 2GB to around 50MB!
     
unityunity