Search code examples
objective-cmemory-managementcocos2d-iphonexcode-instruments

How to find out real memory usage


i want to find out real memory usage of my app with instrument Allocations here is my 2 picture

#1

#2

1st running without any filters and Live Bytes: 14.79 MB

2nd running with filter CF, Malloc, CG, CA types and Live Bytes: 40.94 KB

so which one is real memory usage. if none than how to find out this and i don't know does it matter but everything runes on simulator


Solution

  • #1 is the "real" memory usage of your app.

    Even though CF, CG, etc memory usage may come from iOS libraries, it's your code that ultimately causes the iOS frameworks to allocate memory. So you need to count that as your app's memory usage too.

    Keep in mind that not only running on device vs simulator may affect the end result, it may also make a difference whether you run a debug vs release build. Always profile in release builds because that's what the users will work with.