Xcode Debugger and Memory Graph's memory metric is different from the VM Tracker

65 Views Asked by At

There seems to be a difference between the dirty size captured by VM Tracker and the dirty size captured by Xcode Debugger mode or Memory Graph.

I found out that resident memory size in VM Tracker is near 250MiB and the used memory metric in Xcode Debugger is around 730MB.

So I captured Memory graph and compared metrics between VM Tracker and Memory Graph.

First thing I found is that Xcode Debugger's Memory usage metric is actually memory footprint(Dirty + uncompressed size of Dirty Compressed). Memory Graph and Xcode Debugger compare(https://i.stack.imgur.com/b1xce.jpg)

And then I found out that Dirty size or Resident size is very different between VM Tracker and Memory Graph. Memory Graph dirty size is different from VM Tracker

For example, the dirty size of MALLOC_LARGE was 125M in the Memory Graph, but it was around 39MiB in VM Tracker.

I'm curious why the results of the two profilers are different and which tool's results I should trust more.

EDIT:

These are different scenarios I tried but outcome was all same.

#1 profile same process

  • Record VM Tracker for process 1
  • at the sometime, attach Xcode debugger to same process 1

#2 Profile same build, different process instance

  • Record VM Tracker for process 1, and finish recoding, terminate process 1.
  • Run same build-process 2
  • Attach Xcode debugger to process 2(same build, different instance so it won't affected by VM tracker)
0

There are 0 best solutions below