Converting to ARC

1 reply [Last post]
michel.lonngren
User offline. Last seen 8 years 19 weeks ago. Offline
Joined: 08/01/2012
Posts:

Hi,

I am (for the x:th time) trying to convert my app to ARC. It is a very memory intensive app. Lately I started using GPUImage for some of the image processing (like blending, blurring etc.). Thing are working fine in non-ARC but after converting to ARC the app crashes almost immediately and it seems like it is because GPUImage is hogging memory.

Places that account for basically 100% of my memory usage are -[GPUImagePicture initWithImage:smoothlyScaleOutput:] and -[GPUImageFilter imageFromCurrentlyProcessedOutputWithOrientation:] where some malloc and callocs are being done. I can never see that this memory is being released.

Do I need to do something to make GPUImage release memory. The application is a multi threaded application that does most of the processing in background sending images to the foreground using callbacks for display.

Any ideas would be helpful.

Brad Larson
Brad Larson's picture
User offline. Last seen 4 years 49 weeks ago. Offline
Joined: 05/14/2008
Posts:

Odds are, it's something internal to your application. GPUImage is an ARC-enabled framework, so it always uses ARC for its own compilation. The only thing you've changed by moving your application to ARC is your application itself.

I'd look for retain cycles, which can be very subtle to track down. The heap shot functionality in the Allocations instrument is what I rely on to see where I'm accumulating memory due to cycles like this. Take heap shots before and after every repeat action that could cause memory buildup.

Syndicate content