Hi all,
i am running TM Version 1.5.6 (1414) and have a question regarding memory use..
First, uname -a:
Darwin *.local 8.10.3 Darwin Kernel Version 8.10.3: Wed Jun 27 23:29:36 PDT 2007; root:xnu-792.23.3~1/RELEASE_I386 i386 i386
2.2 CD2 MacBook Pro 2 GB 667 Factory RAM
after opening text files of moderate size (10M-20M) for editing, applying the edits, and closing them, TM retains *lots* of memory (~ 285 MB Real). The memory is only released upon restarting the program. This can be reproduced simply by opening a large text file, closing it, and monitoring RAM usage (top/Activity Monitor).
My question boils down to whether or not this is the desired/expected behavior?
cheers, brant
<*) (_\ _||
On Aug 15, 2007, at 4:06 PM, Brant Faircloth wrote:
[...] The memory is only released upon restarting the program. [...] My question boils down to whether or not this is the desired/ expected behavior?
It is expected, yes.
I have not looked at how libmalloc (or whatever) works, but it seems that when an application allocates memory, it asks the system for some pages, it will manage these pages itself from then on, and if it needs more, it will ask the system for more pages, but it will never give them back.
Since the OS can track page usage, it will swap out pages which hasn’t been used for a while (when the OS runs out of memory), effectively taking back pages from the process, but in practice the page still belongs to the process.
So the reported memory for a process is often its peak usage.
An exception is made e.g. for mmap().
Take the above with a grain of salt, it’s based only on observation (though not of TM alone).