ios - Memory Warning Crash using ARC -


this question has answer here:

i using arc , app crashes saying received memory warning. have used apple instruments , got

http://tinypic.com/view.php?pic=21kedxt&s=5

it looks not have leaks cannot find wrong. crash has memory , due arc cannot use release , sort. first time dealing memory usage using arc. there away can debug since dealing 2 months. have code on git hub helpful if @ it. can find here.

i confused may because need set uiimage instant user capture image nil each time. looks creating instance again without dealloc old image. how able clear stuff. need help. thanks.

the solution adding @autoreleasepool {} statements code. if have loop allocating lot of memory, memory may not freed until application gets main run loop.

you want change loops iterate many times this:

for (id value in largearray) {     @autoreleasepool {         //code creates autoreleased objects     } } 

in above code block, each time loop finishes, autoreleased objects created inside pool released , memory freed use.

some more info can found in this question


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -