On Mon, 23 Jan 2006, Martin Peach wrote:
Mathieu Bouchard wrote:
and then how much RAM do they take once loaded? e.g. on Linux the RAM it's reported (by /proc/$$/maps) to take is 8k (plus one filehandle), that is
One thing I noticed while doing this is that pd (or is it the OS?) doesn't free memory when objects are deleted from a patch.
I was more interested in space taken by a class than by an object... About freeing memory, that's because memory allocators (in libc) are two-level for small areas. The OS only deals with 4k blocks, so a large pool of memory is allocated for all small allocations together. When small allocations get freed, none of the memory gets freed at the OS level, but that memory is still free for future small allocations.
AFAIK, that way of working is the same on all platforms; what may be different from libc to libc is what's the threshold above which allocations requests get forwarded directly to the OS, and what's the memory layout used for small allocations (and for remembering what's in use and what are the current sizes of all allocations).
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada