I am having problems with an application in which memory continues to grow every time I click on a particular view. The sequential process to restore this increase in memory:
- Show login controller
- Click Home View Controller
- Click "View Settings"
- Log User Out (button in the settings view controller) - Pops to User Login View controller
- Input and Start Button Home View Controller
Each time I click on the Home View Controller (although I confirmed that the previous one is freed), the memory jumps up to 6+ mb. I was profiling the application and saw one glaring problem with the VM categories: ImageIO_PNG_Data and VM: CoreAnimation in Allocations.

, Masking View, . , , :
CGRect newRect = self.frame;
if (useCustomFrame){
newRect = customFrame;
}
CGImageRef image = CGImageCreateWithImageInRect([self.projectedImage CGImage], newRect);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(context, 0, rect.size.height);
CGContextScaleCTM(context, 1.0, -1.0);
CGContextDrawImage(context, rect, image);
CGImageRelease(image);