で 25MB のメモリバーストを観察しています[self setImageData:[AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer]];
以下のコード スニペットは、画像をキャプチャし、jpg 形式のデータを提供しています。さらに写真を撮ると、システムはメモリ不足の警告を報告しています。
プロファイラーではリークは見られませんが、アプリケーションが 20MB でもメモリ不足の警告を報告し、アプリケーションがクラッシュすることがあります。
[[self stillImageOutput] captureStillImageAsynchronouslyFromConnection:videoConnection
completionHandler:^(CMSampleBufferRef imageSampleBuffer, NSError *error)
{
[[self captureSession] stopRunning];
if (imageSampleBuffer != NULL)
{
CFDictionaryRef exifAttachments = CMGetAttachment(imageSampleBuffer, kCGImagePropertyExifDictionary, NULL);
if (exifAttachments)
{
NSLog(@"attachements: %@", exifAttachments);
}
[self setImageData:[AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer]];
}
imageSampleBuffer = nil;
// call the designated delegate
[self.aCDMCameraCaptureNotificationDelegate imageDidSuccessfullyCaptured];
}];