Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

App Memory Usage on 4th Gen (Low Memory crash)

I have a completed application that runs great on 2nd Gen iPods, as well as iPhone 3GS and 4. However, when running the app on a 4th Gen iPod, low memory crashes are not uncommon at all.

When I run the app through XCode using the "Activity Monitor" performance tool, I noticed that the application requires roughly 2 to 3 times as much "Real Memory". For example, while the app is consistently between 30-35 MB on the 2nd Gen iPod, on the 4th Gen it fluctuates between 70 to 100 MB (hence the low memory crash).

Has anyone else run into this? Is this drastic increase in memory usage on the 4th Gen to be expected? It's kind of ridiculous to get frequent crashes on the new device that has twice as much memory, when I've never had any problems with memory on the older 2nd Gen.

— asked October 1st 2010 by Mike Dosey
  • 4th
  • activity
  • crash
  • gen
  • ipod
  • leaks
  • low
  • memory
  • mobile
  • monitor
  • performance
  • tool

4 Answers

  • Can anyone with a 4th gen iPod confirm this?

    — answered October 4th 2010 by Mike Dosey
    1 Comment
    • Yes, I can. Mike, does this problem still occur after switching the mobile sdk to v1.5? Also. I just created a premium support ticket on this. I'll keep you posted.

      — commented January 1st 2011 by Brandon Jackson
  • Hi Mike,

    I apologize that this isn't an answer to your question, but I'm really interested to learn more about what you're doing here. I have built two distinct apps, and they both have performance issues. Lots of crashing on the iPhone 3G, and even some sluggish performance on the 3GS and iPhone 4.

    According to Instruments, both apps are using about 35MB of real memory and 314MB of virtual memory.

    How did you determine that your crashes were low memory crashes? Is that indicated somewhere?

    Is it possible to change the iPhone simulator hardware profile so that you can test on older devices? I know you can switch between iPhone and iPhone 4, but that seems to just be for screen size.

    Anyway, maybe we can work on this together to figure out how to diagnose and resolve these performance issues.

    — answered October 4th 2010 by Clifton Labrum
    1 Comment
    • If you open up XCode Organizer (under the "Window" toolbar option), select your device on the left toolbar, then select the "Device Logs" tab, it should pull a list of crashes that have occurred on the device.

      As for changing the simulator hardware profile, I haven't experimented with that myself. I don't think you can depend on the simulator to faithfully mimic hardware limitations related to memory, though.

      Your real memory and virtual memory sound pretty reasonable, not high enough to cause a crash on an iPhone 3GS or 4 (from my limited experience).

      Are you able to run with the "Leaks" performance tool? The application frequently closes when I try, so I've had to rely on the Activity Monitor.

      Is your application very table-heavy? Mine basically consists of grouped table views, a moderately sized SQLite database, and a few scattered icons. Nothing out of the ordinary.

      — commented October 4th 2010 by Mike Dosey
  • Thanks for your response, Mike.

    Yes, I can get the Leaks tool to work. I always have to build the app in Xcode first, then run it with the Leaks tool. The iPhone app closes then reopens with the Leaks data collecting. I haven't seen anything other than this leak on my app, though.

    My app only has one table. It does have about 1MB worth of images (which doesn't seem heavy to me, but you never know). I also have an SQLite DB that's about 2.4MB.

    Overall, I don't feel like I'm doing anything crazy, but I'm still plagued with crashes and slowness on 3G and 3GS. I wish Appcelerator could offer some performance tips.

    — answered October 4th 2010 by Clifton Labrum
  • Were you able to confirm that the crashes were "Low Memory" crashes in the XCode organizer?

    — answered October 5th 2010 by Mike Dosey
    1 Comment
    • I just tried again and got the "Low Memory" symptoms where the app goes black and I can't do anything but quit. There wasn't a low memory report in Organizer, so I suppose that it means memory wasn't an issue. I was only around 25MB of real memory at the time, too.

      I wish I knew what reasonable memory tolerances were for an app. For example, if you're using more than 40MB, you'll have trouble on devices X, Y, Z, and so on. Some kind of performance guide from Appcelerator would be great.

      — commented October 6th 2010 by Clifton Labrum
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.