application crash on iPhone device

0 views
Skip to first unread message

prateek

unread,
Dec 22, 2009, 7:40:08 AM12/22/09
to iPhone SDK Development
Hello,

I have developed one iPhone application with Snow Leopard (10.6.2) and
Xcode (3.2.1). As many of us know that in this new version of Xcode we
get facility of Build and Analyze (to check memory leaks and other
issues). When I build and analyze my application, it gives me no
error / no warnings.

My application runs fine on simulator also.

Now, I try to test the application on iPhone device (device
configuration: iPhone 2G and iPhone OS 3.0) with 8GB memory.

The problem is that application starts well on iPhone device but after
some time, it crashes.

When I see the console from Window->Organizer->Console. I see
following error:

Tue Dec 22 17:17:39 unknown SpringBoard[27] : Memory level is urgent
(8%) and there are no background apps to ask to exit.

Please help me.

Regards, Pratik

Anne-Lise Hassenklover

unread,
Dec 22, 2009, 1:35:27 PM12/22/09
to iphonesdkd...@googlegroups.com
In Xcode have your build for Simulator/Debug and choose Run->Start With Performance Tools->Leaks

See if that reports any problems,
- Anne-Lise



From: prateek <pratik....@gmail.com>
Reply-To: <iphonesdkd...@googlegroups.com>
Date: Tue, 22 Dec 2009 04:40:08 -0800
To: iPhone SDK Development <iphonesdkd...@googlegroups.com>
Subject: application crash on iPhone device

--

You received this message because you are subscribed to the Google Groups "iPhone SDK Development" group.
To post to this group, send email to iphonesdkd...@googlegroups.com.
To unsubscribe from this group, send email to iphonesdkdevelop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/iphonesdkdevelopment?hl=en.


Jesse Tayler

unread,
Dec 22, 2009, 1:49:01 PM12/22/09
to iphonesdkd...@googlegroups.com
It's important to note that you don't have to leak memory to use too much of it on the device while still running fine on simulator.

memory situations on the 'simulator' are different than the native device - dramatically different! so, this is something you should expect to test for on a device.

perhaps you need to bound a long running loop in an autorelease pool?

sometimes a loop can generate a lot of objects which are not released until the thread returns to the main loop and in such cases, you can let go of that memory on the fly by using an nsautoreleasepool and releasing it during the loop.

that would not be a leak, but would be a situation where you use up too much memory at once on the device.

David Phillip Oster

unread,
Dec 23, 2009, 3:23:50 PM12/23/09
to iPhone SDK Development
Memory allocation behavior is similar enough between the simulator and
the device, that using either:

Run > Start With Performance Tool > Leaks
or
Run > Start With Performance Tool > ObjectAllocation

will quickly show what you're leaking and where it was allocated.

An 8GB iPhone has about 12M for your app. It's very easy to leak a few
large images and have no room left.

Reply all
Reply to author
Forward
0 new messages