• 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 : Memory management (release)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re : Memory management (release)


  • Subject: Re : Memory management (release)
  • From: mic3d <email@hidden>
  • Date: Tue, 11 May 2004 13:02:54 +0200

Hello :)

My problem is Unix release her memory pages after last object release in for(...) and not at release (but object is really released).

(French) You can found code sample at : http://forum.macbidouille.com/index.php?showtopic=73842

Thanks,
Michael and her bad english...


Le 07 mai 2004, ` 18:54, Fritz Anderson a icrit :

First, never send the dealloc message yourself. It will be sent automatically upon the last release of the object.

Second, the example code you show should allocate and immediately release an NSImage. What leads you to believe it does not? An increase in memory statistics in top or Activity Monitor is not a sure indicator, as the malloc system might not return the image memory to the system.

-- F

On 6 May 2004, at 6:13 PM, mic3d wrote:

In this code :

NSArray *array=[[NSFileManager defaultManager] directoryContentsAtPath:path];

NSEnumerator *e=[array objectEnumerator];
NSString *item;
while (item=[e nextObject])
{
NSImage *img=[[NSImage alloc] initWithContentsOfFile:[path stringByAppendingPathComponent:item]];
[img release]; // or [img dealloc]
}

OR :
[similar]

Memory don't liberate release is sended but at end of function.

Please, tell me what release don't work immediately,
_______________________________________________
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.


  • Prev by Date: Multiple Threads and DO over Rencezvous
  • Next by Date: Re: Can NSImage use image masks?
  • Previous by thread: Multiple Threads and DO over Rencezvous
  • Next by thread: GMT offset of Created file date
  • Index(es):
    • Date
    • Thread