How do you go about profiling memory usage on iOS devices

I was wondering what methods the Unity community is using to profile memory usages of a Unity app on iOS devices. As we all are aware of from iPhone 3gs - iPhone4 they have different amount of memory available to the app, and of course same goes from ipad 1 - 3.

Im trying to find best practices for profiling with either a combo of Unity Profiler, and or Xcode Instruments, Ideally we would like to get a grip on:

  • How much total memory is in use
  • How much goes to textures
  • How much goes to animations
  • How much goes to audio
  • How much a certain prefab is using (helps us figure out where issues are)

any thoughts?

I can’t make the unity external profiler, the internal profiler and instruments agree on memory useage at all at the moment.

I’m guessing instruments is most accurate, but I’d love to know where the 20Mb discrepancy between them is.

The 20mb could be one of two things:

  1. The application binary itself (thats without stripping or with an enabled dev build in the 17-20mb range)
  2. used texture memory which the instruments will pick up as they look at more than one process while unity only profiles ‘real memory’ not the virtual memory mapped VRAM

I wondered that. I couldn’t see which of the profilers would include the binary though, they all claim to be heaps. For the record I think the internal profiler was equivalent to instruments, but the unity profiler was optimistic. It showed something like Total 40mb, Textures 39.1Mb! Making me think total is not including vram.

That fits. Although I thought I had to switch to VM profiling in instruments to get a sense of the Open GL mapped memory…

I’m not sure if it is comforting or not, but I see a similar disparity profiling on windows.

Profiling must add a huge cost to each allocation.

85.5/16.3 = 5.2x
210.4/49.7 = 4.2x

Non development builds, gets me 78Mb and 190Mb in the task manager for the same two scenarios. Meaning the development build isn’t adding much. Something fishy is going on…

Have you guys tried to set up instruments for xcode, and what are the best dashboards to use to look at whats going on ?