• 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
Why does the memory increase?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why does the memory increase?


  • Subject: Why does the memory increase?
  • From: Lorenzo Puleo <email@hidden>
  • Date: Thu, 06 Jun 2002 16:41:38 +0200

Hi,
Before launching this task the memory was 5MB, and at the end of this task
the memory remains at 9MB. Since I remove all the objects from the instance
gItemsToCopyArray, it should come back to the initial value...
Please, may someone explain/fix this?


- (void)StartTask
{
int i;
gItemsToCopyArray = [NSMutableArray arrayWithCapacity:0];
[gItemsToCopyArray retain];

for(i=0; i < 50000; i++){
[self AddObjectToList];
}

[gItemsToCopyArray removeAllObjects];
[gItemsToCopyArray release];
}

- (void)AddObjectToList
{
int i;
NSMutableDictionary *dict = [NSMutableDictionary dictionary];

for(i = 0; i<10; i++){
[dict setObject:[NSNumber numberWithInt:i] forKey:@"Name"];
[gItemsToCopyArray addObject:dict];
}
}


Thank you
--
Lorenzo Puleo
mailto:email@hidden
_______________________________________________
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.

  • Follow-Ups:
    • Re: Why does the memory increase?
      • From: "Timothy J. Wood" <email@hidden>
    • Re: Why does the memory increase?
      • From: Chris Ridd <email@hidden>
  • Prev by Date: Re: http NSURLHandle subclass
  • Next by Date: Re: Custom control
  • Previous by thread: Re: Custom control
  • Next by thread: Re: Why does the memory increase?
  • Index(es):
    • Date
    • Thread