• 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
Memory and dictionary's setObject : strange behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Popups in PB
      • From: Roarke Lynch <email@hidden>
  • Prev by Date: Drag to Finder
  • Next by Date: NSBrowser's Designated Initializer
  • Previous by thread: Drag to Finder
  • Next by thread: Popups in PB
  • Index(es):
    • Date
    • Thread