Re: Recursive Calls increase the memory
Re: Recursive Calls increase the memory
- Subject: Re: Recursive Calls increase the memory
- From: Nat! <email@hidden>
- Date: Wed, 5 Jun 2002 01:00:36 +0200
Am Dienstag den, 4. Juni 2002, um 20:41, schrieb Lorenzo Puleo:
Hi,
I call recursively a routine, and my application memory grows in
infinite
way. I saw this with the tool "ProcessViewer".
- (void)CopyItems:(NSArray*)theArray
{
int i, totItems, copyMode;
NSDictionary *taskDict;
NSString *source, *dest;
NSArray *subItems;
BOOL ok = YES;
totItems = [theArray count];
for(i = 0; i < totItems; i++){
taskDict = [theArray objectAtIndex:i];
source = [taskDict objectForKey:@"source"];
dest = [taskDict objectForKey:@"dest"];
gGlobalItemsToDo--;
// just to isolate the trouble
// I commented the following line. The trouble persists.
//[self CopySource:source toDest:dest copyMode:copyMode];
subItems = [taskDict objectForKey:@"subItems"];
if(subItems != nil){ // it's a folder
[self CopyItems:subItems];
subItems = nil;
}
taskDict = nil;
source = nil;
dest = nil;
}
}
Since this routine is only reading data and not copying or
allocating anything, I don't believe that this method as is - is
responsible for any increase in memory allocation.
The problem is elsewhere, maybe just a missing autorelease pool.
Ciao
Nat!
Jedenfalls sind zehn Fehlstarts hintereinander [E. Fuchs]
ein sehr interessanter Beweis
f|r unsere Theorie
von der nat|rlichen \berlegenheit des Dezimalsystems
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.