Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

5.4.1: Unity's profiler device memory consumption differs from XCode numbers

Discussion in 'iOS and tvOS' started by pachash, Oct 5, 2016.

  1. pachash

    pachash

    Joined:
    Apr 2, 2014
    Posts:
    55
    Hi!

    I'm trying to investigate why my game consumes a lot of memory on an iOS device(almost 300Mb).

    For this purpose I built a dev. version of the game and launched it on a device. Connected with a Unity's profiler and it showed me that the game consumed 223 Mb.



    But XCode profiler shows different numbers, 299 Mb:



    Wow. How can this be explained? How do I know where those almost 80 Mb came from?
     
    Last edited: Oct 11, 2016
  2. christophergoy

    christophergoy

    Joined:
    Sep 16, 2015
    Posts:
    735
    Hi @pachash,
    Were you able to profile your game with the Xcode instruments tool? This give you a more in depth view of how memory is being allocated. Specifically if you use the Allocation tool with VM Tracker. Could you use that to profile your game and let us know the findings?
    Cheers,
    Chris
     
  3. pachash

    pachash

    Joined:
    Apr 2, 2014
    Posts:
    55
    @christophergoy Yep, sure, here the screenshots taken from the Unity profiler and Instruments VM tracker:




    As you can see the difference is huge: 155 Mb VS 262 Mb
     
  4. pachash

    pachash

    Joined:
    Apr 2, 2014
    Posts:
    55
    I googled around, AFAIK IOKit is responsible for textures, right? VM_ALLOCATE contains mono allocations, right?
     
  5. pachash

    pachash

    Joined:
    Apr 2, 2014
    Posts:
    55
    No ideas?
     
  6. Ironwolf21

    Ironwolf21

    Joined:
    Aug 15, 2014
    Posts:
    6
    I'm having the same issue. Xcode is reporting around 100mb more than unity profiler stats. Trying to isolate what is causing the difference.