Dirty Memory because of CoreAnimation and CG image

2019-07-31 08:34发布

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

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条回答
兄弟一词,经得起流年.
2楼-- · 2019-07-31 09:23

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.

查看更多
登录 后发表回答