Who gets leaked memory?
Who gets leaked memory?
- Subject: Who gets leaked memory?
- From: Shin Yamamoto <email@hidden>
- Date: Wed, 6 Jun 2001 11:17:29 +0900
Suppose I forget to release/free memory when my app terminates and
suppose the leaked memory consists of NSString and NSWindow instances.
My understanding is, in the case of Foundation's objects, that it will
be eventually cleared by mach since it has been allocated in the
application's heap. But what happens to window objects? I ask this
because of the statement in the System overview that window objects are
managed by the Window Server. Does this mean that the leaked memory
continues to dangle until a user logs out or even after that? If this is
the case, would the leak leave any consequences regarding Window
Server's behavior? I've been experiencing the server locking up from
time to time and I end up killing the server from the remote host. I'm
suspecting the culprit is me or my apps.
In the Don Yackman's WWDC note at Stepwise
(
http://www.stepwise.com/SpecialCoverage/WWDC2001/900.html), he states
"in a nib file, all top level objects have a retain count of one and it
is the responsibility of the File's Owner to actually release all of
these objects. If the File's owner doesn't release them all, then there
will be leaks." If this is true, and I have no reason to doubt that,
I've been leaking *a lot of* memory because I thought nib objects were
released automatically.
Thanks
shin