Memory footprint of an app on iPhone

| | August 7, 2015

I recently had an app rejected from the app store because of Low Memory Exception. The app doesn’t leak memory, but its base memory footprint seems to be too high. According to the crash logs sent by apple, it was taking about 14000 pages in the memory (mostly due to huge textures). There were 2 strange things though:

  1. I tested it on 5 devices rigorously before submitting, and never got this crash on any one of them.
  2. I did optimize the textures after the rejection, and brought them to about half the original size (texture memory consumption).

I have no way of knowing how many pages my app is taking now, unless I can reproduce the same crash as apple (which I never could). Is there another way to be able to find out the memory footprint of my app, so that I can be sure that it is optimized enough now.

I did try instruments, but my app crashes when I try to run it through my XCode (must be some problem with my XCode). But it works perfectly when I run it directly on my iPhones/iPods. Any help in finding out the memory footprint of my app on iPhone (if there is something analogous to task manager of windows), would be appreciated.

Thanks

EDIT:

  1. Launching the app from XCode gives the following error in the console:
    “Error launching remote program: failed to get the task for process 553.”

  2. Launching the app with Activity Monitor gives the following error:
    “Target terminated too early to collect data”

EDIT2:

I was able to run my app with Activity Monitor, by using a dev profile instead of distribution profile. But now there are several sections in the Activity Monitor – Physical Memory Used, Real Memory, Virtual Memory. Which one of these do I consider. To sum it up, I need to know which one of these causes the iPhone to throw a Low Memory exception.

2 Responses to “Memory footprint of an app on iPhone”

  1. Stephen Darlington on November 30, -0001 @ 12:00 AM

    I think you’re coming at this from the wrong angle. You’re asking how to find the memory footprint without using XCode. I think the question you should be asking is: why can you not use XCode? Presumably that’s what you used to develop the application in the first place?

    Without XCode you’re pretty much flying blind. You say you halved the size of your textures, but how do you know? Does your app release any extraneous memory when it gets a low memory warning? (applicationDidReceiveMemoryWarning:)

    First, have you looked at the crash logs from when you run your app from XCode? You should be able to see them in the Organiser in XCode.

    I’m not sure there’s a single solution to stop your app crashing with XCode. Normally when my iPhone won’t allow debugging I just restart xCode and my handset and it starts working again. Restarting XCode sometimes helps. I would also try reinstalling both XCode and the iPhone SDK.

  2. XCode -> Run -> Run With Performance Tool -> Activity Monitor.

    If the device is connected, Activity Monitor runs on the iPhone/iTouch.

Leave a Reply