hi,I have some question when I upload 50 video (about 1GB) at a time from the gallery,It crashed frequently in iphone 6s 11.2.6 16G
but it didn't happen on iPhone 6s 32G and iphone 7p 32G,and Xcode didn’t output anything crash information
but i got some information from Mac console like this
EXC_RESOURCE -> QCloudCOSBrowser[6180] exceeded mem limit: ActiveHard 1400 MB (fatal)
83826.914 memorystatus: killing_specific_process pid 6180 [QCloudCOSBrowser] (per-process-limit 10) - memorystatus_available_pages: 71
this is my code
for (int i = 0; i < assets.count; i++) {
@autoreleasepool {
PHAsset *asset = assets[i];
if (asset.mediaType == PHAssetMediaTypeVideo) {
[[TZImageManager manager] getVideoWithAsset:asset completion:^(AVPlayerItem *playerItem, NSDictionary *info) {
if (info[@"PHImageFileSandboxExtensionTokenKey"]) {
NSArray *tmpArray = [info[@"PHImageFileSandboxExtensionTokenKey"] componentsSeparatedByString:@";"];
NSString *filePathStr = [tmpArray[tmpArray.count - 1]substringFromIndex:9];
NSString* fileName = [asset valueForKey:@"filename"];
NSArray *array = [fileName componentsSeparatedByString:@"."];
NSString* tempFile = QCloudDocumentsTempFile(array[0], array[1]);
NSData *videoData = [NSData dataWithContentsOfURL:[NSURL fileURLWithPath:filePathStr]];
[[CBFileManager shareInstance] writeFileAsync:tempFile data:videoData complete:^(BOOL result) {
if (result) {
}
}];
}else if([info objectForKey:@"PHImageResultIsInCloudKey"]){
PHVideoRequestOptions* options = [[PHVideoRequestOptions alloc] init];
options.version = PHVideoRequestOptionsVersionOriginal;
options.deliveryMode = PHVideoRequestOptionsDeliveryModeAutomatic;
options.networkAccessAllowed = YES;
[[PHImageManager defaultManager] requestAVAssetForVideo:asset options:options resultHandler:^(AVAsset* avasset, AVAudioMix* audioMix, NSDictionary* info){
AVURLAsset *videoAsset = (AVURLAsset*)avasset;
NSString *filePathStr = videoAsset.URL.relativePath;
NSString* fileName = [asset valueForKey:@"filename"];
NSArray *array = [fileName componentsSeparatedByString:@"."];
NSString* tempFile = QCloudDocumentsTempFile(array[0], array[1]);
NSData *videoData = [NSData dataWithContentsOfURL:[NSURL fileURLWithPath:filePathStr]];
[[CBFileManager shareInstance] writeFileAsync:tempFile data:videoData complete:^(BOOL result) {
if (result) {
}
}];
}];
}
}];
}
}
}
Looking forward to your reply