XCode Instruments Allocations: Look at Live Bytes or Overall Bytes?

Nic Hubbard picture Nic Hubbard · Sep 27, 2011 · Viewed 19.5k times · Source

I am getting some memory warning in my iOS app so I am running Instruments to see the allocations. Should I look at the * All Allocations * Live Bytes or Overall Bytes?

Someone said the iOS can close my app if I use for 22MB, is that from the Live or Overall bytes section?

enter image description here

Answer

zaph picture zaph · Sep 27, 2011

Live Bytes is the current usage and is what you are interested in, overall bytes includes all released allocation. The other thing is to look at the graph and look for peaks. As an example I saw a huge peak of about 27MB in an app I was working on, knowing that I was able to reduce peak memory usage to 8MB.

Also watch over time as you exercise your app, it is possible to have substantial memory growth over time that is not leaked, just not not used anymore.

For a description of the memory columns see Explanation of Live Bytes & Overall Bytes.