tags:

views:

93

answers:

1

Has anyone else observed this phenomenon? Is there any clue as to the cause and/or workaround?

Thank you in advance.

A: 

Some clues as to what your app is doing when it hangs would help however :

The 3g has far less memory. Check for leaks and use the Object Allocation and Leaks performance tools.

While checking you may as well run the CPU sampler.

You may also crash the app if you try to use any of the 3G features (magnetic compass, video etc) which are not present on the 2G. However, it if survives the simulator, this is unlikely to be the problem - memory is the most likely culprit IMHO

Andiih
That makes a lot of sense. However, there are no memory leaks. Also, this typically happens only when the application is loading. If it succeeds in loading, it will run forever.No error is thrown.
McPragma
Again some info on architecture would help. Try to limit the objects instantiated on startup. There may be an error in a XIB. Add NSLog statements to all startup code: appdelegate, init, viewDidLoad, viewWillAppear to track roughly where its failing.
Andiih
Even if there are no memory leaks, the peak memory foot print might be too large for the iPhone 3G, but might be manageable by the 3GS. Available memory might change between app starts and hence might work every once in a while.
Felix
That's good advice Andiih. However, there are very few objects created at startup, and none created thereafter. However, there is a lot of code. The application is around 9Mb.However, Felix is on to something. The question is WHY does available memory change between app starts when the user starts from the same place? This is an honest question. If it is an operating system issue, it has the unfortunate appearance of an application issue.
McPragma
My point is, if Felix is correct, the iPhone operating system should inform the user "you don't have enough memory - reset your iPhone or try later or something like that". Since the application loads and runs intermittently, some memory consolidation must be happening in the operating system. Why would that be intermittent?Also, if it is a memory issue at the application level, shouldn't app delegate receive notification through applicationDidReceiveMemoryWarning. In our case, it does not.
McPragma
Applications should be able to weather low-memory conditions. If your app can't even launch, I consider that a bug in your application and not the OS.
rpetrich