Re: weird ObjectAlloc
Re: weird ObjectAlloc
- Subject: Re: weird ObjectAlloc
- From: James Bucanek <email@hidden>
- Date: Sat, 21 Oct 2006 08:16:16 -0700
Camille GOUREAU-SUIGNARD wrote on Saturday, October 21, 2006:
>I just tried something:
>
>I built a brand new empry application.
>
>I ran it under ObjectAlloc.
>
>When I quit there are still 8403 objects (current total).
>
>Is this normal ?
This is really a Cocoa question:
<http://lists.apple.com/mailman/listinfo/cocoa-dev>
However, I'm sure it's normal. A lot of objects never get released and simply rely on the process termination to reclaim their resources. I do this often with singleton objects, buffers, and caches. It wouldn't surprise me if the frameworks are filled with such objects.
But just to bring it back to Xcode, be aware of that certain debugging settings can effect ObjectAlloc and similar tools, especially NSZombieEnabled and its related settings.
NSZombieEnabled causes released objects to be "zombified"; this changes the class of the object to one that will catch any attempt to send it another message, but also has the side effect of retaining the object indefinitely. I can't count the number of times that I've had my application run out of memory and fired up ObjectAlloc to find out why, only to discover that none of my objects are ever released. After a moment of panic, I remember that I had set NSZombieEnabled in the executable's environment.
See <http://developer.apple.com/technotes/tn2004/tn2124.html> for addition NSZombie details.
James Bucanek
____________________________________________________________________
Author of Beginning Xcode ISBN: 047175479X
<http://www.beginningxcode.com/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden