次のコードがクラッシュします。基本的に、ファイルとして保存された非常に大きな文字列(xml-画像データを含む)にアクセスしています...それを変更して新しい名前で保存しています...プロファイリング時に、このコードでリークは見られませんでした。 ..しかし、このプロセスを20〜25回繰り返した後、アプリはメモリ警告レベル3のiphone 3gsでクラッシュし、実行中のアプリ全体も強制終了します...このアプリがリークして原因となる場所が見つかりませんメモリ警告....任意の提案
NSAutoreleasePool *pool=[[NSAutoreleasePool alloc] init];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
 NSString *documents = [paths objectAtIndex:0];
 NSString *filename = [NSString stringWithFormat:@"%@.yyy",fileToDuplicate];
 NSString *initPath = [documents stringByAppendingPathComponent:filename];
 NSString *final = [NSString stringWithFormat:@"%@.yyy",[[alertView textFieldAtIndex:0] text]];
 NSString *finalPath = [documents stringByAppendingPathComponent:final];
 NSString *newName=[[[alertView textFieldAtIndex:0] text] copy];
 NSError *error;
 NSString *xml = [[NSString alloc] initWithContentsOfFile:initPath encoding:NSASCIIStringEncoding error:&error] ;
 NSString *xml_1=[xml stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"<file_name><name>%@.yyy</name></file_name>",fileToDuplicate] withString:[NSString stringWithFormat:@"<file_name><name>%@.yyy</name></file_name>",newName]];
NSString *xml_2=[xml_1 stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"<property_name>%@</property_name>",fileToDuplicate] withString:[NSString stringWithFormat:@"<property_name>%@</property_name>",newName]];
[xml_2 writeToFile:finalPath atomically:YES encoding:NSASCIIStringEncoding error:&error];
 xml=nil;
 [xml release];
 xml_1=nil;
 xml_2=nil;
 [self.mTableView reloadData];
 fileToDuplicate=@"";
 [newName release];
 [pool drain];
 return ;