I am using an image to fill the color in the current graphics context using the following statement:
CGContextSetFillColorWithColor(aContext,[[UIColor colorWithPatternImage:[UIImage imageNamed:kRunnerGradientedBackgroundImage]] CGColor]);
This statement suddenly spikes my memory usage from 1.3 MB to 5.6 MB. If I release the UIImage object then it comes down to 1.3 MB but since retain count of image object is already 0, I cannot do this.
Any suggestions how to control this sudden memory spike?
I have removed the image and now drawing the gradient using code. This reduced the memory spike by 4.5 MB.