I'm using the following method of reading a text file one line at a time (1.1 million total lines) and the memory footprint of my app on the simulator grows to the total filesize of the text file (480MB). Do I need to implement an autorelease pool drain to manage the memory consumption?
How to read data from NSFileHandle line by line?
NSString *docDir = [AppSession documentsDirectory];
NSString *csvpath = [docDir stringByAppendingPathComponent:@"/docs/output.csv"];
__block NSUInteger count = 0;
DDFileReader * reader = [[DDFileReader alloc] initWithFilePath:csvpath];
[reader enumerateLinesUsingBlock:^(NSString * line, BOOL * stop)
{
count++;
}];
NSLog(@"FINAL COUNT %i", count);
[reader release];