Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My iphone app gets memory warning and killed at 6.8MB

My app has a thread that does some time consuming job for more than a minute and the app consumes around 6.8MB of memory. I receive a memory warning after sometime and then it gets killed. There is nothing that I can release, and I am using not even 7MB of memory...driving me crazy...any advice please?

like image 559
Abix Avatar asked May 20 '10 16:05

Abix


Video Answer


2 Answers

Maybe your memory is super-fragmented? Even 7mb full of leaked data shouldn't kill your app. You ought to have at least 20mb to play with. Try rebooting the phone and see if that helps.

like image 75
Dan Ray Avatar answered Oct 09 '22 03:10

Dan Ray


I still do not know why it is happening, but now I have a found a workaround. Instead of running this job in a thread, if I run it on the main thread, neither I receive memory warning not it gets killed. But then I cannot show the progress in the UI. I am going to use NSTimer to do it.

like image 43
Abix Avatar answered Oct 09 '22 01:10

Abix