Dirty Memory because of CoreAnimation and CG image

2019-07-31 09:11发布

问题:

I have a Problem in my App with the Dirty Memory Size and want to clear out the dirty memory.

My App is growing bigger and bigger. But the main Problem is the CoreAnimation and the CG Image type. Memory Tag 70 is beeing cleared thru my Assync Image Load View.

How can i clear CoreAnimation and CG Image from the dirty memory? 57% dirty memory of the resident seems a bit high for me.

回答1:

Maybe you had not released them, use CGImageRelease(cgImage), CGPathRelease(path);, etc. Like:

CGImageRef cgImage = CGImageCreateWithImageInRect(fullImage.CGImage, CGRectMake(...));
UIImage * image = [UIImage imageWithCGImage:cgImage];
CGImageRelease(cgImage);

and for core animation's path

CGMutablePathRef path = CGPathCreateMutable();
...
CGPathRelease(path);

and so on.