title: VM: CG raster Data memory keep growing
body: <p>so i am trying to make an app that will let the user change the color of the UIImage, for that i am using this function i found</p>
  
  <pre><code> - (UIImage *)imageWithTintColor:(UIColor *)color fraction:(CGFloat)fraction
  {
      if (color)
      {
          UIImage *image;
          if ([UIScreen instancesRespondToSelector:@selector(scale)])
          {
              UIGraphicsBeginImageContextWithOptions([self size], NO, 0.f);
          }
          else
         {
             UIGraphicsBeginImageContext([self size]);
         }
  
         CGRect rect = CGRectZero;
         rect.size = [self size];
         [color set];
         UIRectFill(rect);
  
         [self drawInRect:rect blendMode:kCGBlendModeDestinationIn alpha:1.0];
  
         if (fraction &gt; 0.0)
         {
             [self drawInRect:rect blendMode:kCGBlendModeSourceAtop alpha:fraction];
         }
         image = UIGraphicsGetImageFromCurrentImageContext();
         UIGraphicsEndImageContext();
         return image;
     }
     return self;
  }
  </code></pre>
  
  <p>everything works but the CG raster Data is growing in memory<img src="https://i.stack.imgur.com/EGH25.png" alt="enter image description here"></p>