title: UIImageJPEGRepresentation
body: <p>I have troubles finding a memory leak which then again causes my App to crash. It seems that the memory allocated for the JPEGRepresentation does not get released. This is even more curious because the NSData Object created by UIImageJPEGRepresentation is only about 300 kb big (dependend on the image), but the memory usage jumps up by about 3-5 megabyte per image at this stage.</p>
  
  <p>This is the code</p>
  
  <pre><code>QueuedObject* queuedObject = [[QueuedObject alloc] init];
  [queuedObject setUrl:url];
  
  QueuedObjectData* jsonQueuedData = [[QueuedObjectData alloc] init];
  [jsonQueuedData setData:jsonData];
  [jsonQueuedData setFilename:@"message.json"];
  [jsonQueuedData setContentType:@"application/json"];
  [jsonQueuedData setKeyValue:@"JSONMessage"];
  [queuedObject addData:jsonQueuedData];
  
  int i=1;
  
  QueuedObjectData* imageData = [[QueuedObjectData alloc] init];
  
  for(id file in files)
  {
      if(file!=nil)
      {
          [imageData setData:UIImageJPEGRepresentation(file, 0.8)];
          [imageData setFilename:[NSString stringWithFormat:@"image%d.jpg",i]];
          [imageData setContentType:@"image/jpeg"];
          [imageData setKeyValue:@"image"];
          [queuedObject addData:imageData];
          i++;
      }
  }
  
  [[UploadQueue sharedInstance] addObject:queuedObject];
  
  
  [jsonQueuedData release];
  [jsonData release];
  [url release];
  [imageData release];
  [queuedObject release];
  </code></pre>
  
  <p>Maybe you have an idea to help me</p>
  
  <p>best regards
  Manuel</p>