Rendering CALayer in context uses large amounts of memory
- by Otium
I am taking a snapshot of a UIWebView layer, but when I render the webview's layer in the current context my app uses 10mb more memory, and I don't think that should be right. Here is my current code:
CGSize imageSize = self.bounds.size;
UIGraphicsBeginImageContextWithOptions(imageSize, YES, 0);
CGContextRef context = UIGraphicsGetCurrentContext();
[self.layer renderInContext:context];
_snapshot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();