Memory and dictionary's setObject : strange behavior
Memory and dictionary's setObject : strange behavior
- Subject: Memory and dictionary's setObject : strange behavior
- From: kubernan <email@hidden>
- Date: Fri, 24 Jan 2003 00:06:09 +0100
Hello,
Trying to catch memory leak in my foundation software i could
see a strange behavior :
Each time i call this method :
-(void)setValue:(double)aValue forId:(NSString *)key
{
[value setObject:[NSNumber numberWithDouble:aValue] forKey:key];
}
I can see the %memory increase in the Process Viewer app for my
application,
even if key contains the same string value for each call. I mean the
value dictionary contains
always only one item because previous item is replaced for each call ;
it's like :
[value removeObjectForKey:key];
[value setObject: ... forKey:key];
So ...
When i add NSLog(key); **before** [value setObject ...] the %memory
doesn't increase :
in fact the %memory stay the same.
How to explain that ?
Thx a lot for your explanation,
K.
_______________________________________________
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.