Search code examples
iosmemorymemory-managementinstrumentsram

"live bytes" different on simulator versus device


I have a program that is showing, in the allocations instrument, approx. 72 MB of "live bytes" but when I run the profiling on my iPod touch, it shows 6 MB. I don't understand why the vast difference. Can anybody please explain this?


Solution

  • Keep in mind that the iOS Simulator is a simulator, not an emulator.

    The iOS Simulator works by compiling your iOS application to x86 code, and linking it against a set of system frameworks which simulate their iOS equivalents on a desktop computer. These frameworks are, of necessity, not identical to those that you'd find on "real" iOS -- they are, after all, compiled for a different CPU architecture, and are "talking to" desktop hardware, not a handheld device.

    Knowing this, it should be understandable that some aspects of application performance may be radically different on the Simulator than on a real device. Keep this in mind, and test your code early and often on real hardware!