• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Recursive Calls increase the memory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Recursive Calls increase the memory (From: Lorenzo Puleo <email@hidden>)

  • Prev by Date: RE: drawing NOW in a callback, boom!
  • Next by Date: (no subject)
  • Previous by thread: Recursive Calls increase the memory
  • Next by thread: Troubles with [NSWindow setMiniwindowImage]
  • Index(es):
    • Date
    • Thread