Re: NSKeyedUnarchiver unarchiveObjectWithFile - memory not being freed but no leaks?

  • On Mon, 2 Oct 2006 15:31:49 +0100, nick briggs <nick...> 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 = <matt...>, <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>
previous month october 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today