List Info

Thread: Profiling Perl app memory usage




Profiling Perl app memory usage
user name
2006-02-03 14:12:08
Nicholas Clark <nickccl4.org> wrote:
[...]
> Is wrapping a call to sbrk(0) with Inline::C good
enough?

IME, modern systems will prefer to use anonymous mmap()
space and only
fall back to sbrk() when that space is exhausted. The main
reason
mmap() space can be released with munmap() but sbrk() space
is not
released until the program exits, so sbrk() should only be
used in an
emergency.

The default sizes on an i386 Linux box are 2GB of mmap()
space and 1GB
of sbrk() space. So a call to sbrk(0) will only give you
useful
information useful whe you have already consumed 2GB of
memory, and
also will not tell you if the process shrinks.

-- 
PGP key ID E85DC776 - finger abusemooli.org.uk for full key
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )