Why does the memory increase?
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.