Re: NSKeyedUnarchiver unarchiveObjectWithFile - memory not being freed but no leaks?
Re: NSKeyedUnarchiver unarchiveObjectWithFile - memory not being freed but no leaks?
- Subject: Re: NSKeyedUnarchiver unarchiveObjectWithFile - memory not being freed but no leaks?
- From: Matt Neuburg <email@hidden>
- Date: Mon, 02 Oct 2006 10:40:24 -0700
- Thread-topic: NSKeyedUnarchiver unarchiveObjectWithFile - memory not being freed but no leaks?
On Mon, 2 Oct 2006 15:31:49 +0100, nick briggs <email@hidden> said:
>Hello All
>
>Our app uses large data files which we are reading from disk with
>NSKeyedUnarchiver unarchiveObjectWithFile. the root object being a
>mutable array of mutable dictionaries
>
>When we release the array, expecting the memory to be freed, its not,
>well to be exact it decreases by 2m.
>
>So we run the app again with MallocStackLogging on, and then run
>'leaks', none are reported.
>
>Now if we use the fillMemoryWithData function, the memory is
>allocated and released exactly as expected.
>
>So what gives, we thought we had a pretty good understanding of objc
>memory patterns, but this is really confusing us.
Could this be the same answer I just gave two days ago?
<http://www.cocoabuilder.com/archive/message/cocoa/2004/3/20/102131>
Might not be, but it's worth a look. People forget about virtual memory,
which is a whole different thing from Cocoa's explicit memory management. If
you read a file, Mac OS X (not Cocoa!) maps that section of disk into
virtual memory. If you read a lot of big files, that's a lot of virtual
memory.
m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden