Autorelease Pool到底怎么用

分析一些代码:

case1:

- (void)viewDidLoad {
    for (int i=0; i<1000000000; i++) {
        NSObject *o = [[NSObject alloc] init];
    }
}

case2:

- (void)viewDidLoad {
    for (int i=0; i<1000000000; i++) {
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init];
        NSObject *o = [[NSObject alloc] init];
        [pool drain];
    }
}

case3:

- (void)viewDidLoad {
    for (int i=0; i<1000000000; i …