Why does the position of @autoreleasepool matter?
问题 I'm having trouble understanding how @autoreleasepool work. Consider the following example in which I am creating an AVAssetReader for an audiofile. To make the memory impact matter, I repeated this step 1000 times. #import <Foundation/Foundation.h> #import <AVFoundation/AVFoundation.h> void memoryTest() { NSURL *url = [[NSURL alloc] initWithString:@"path-to-mp3-file"]; AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:url options:nil]; AVAssetReader *reader = [[AVAssetReader alloc]