On Thursday 21 June 2007 18:50, Alex Kums wrote:
> I have a question about memory usage in busybox. Say, busybox eat 100 Kb 
> of memory. If I run telnetd, cron and httpd, will these three instances of 
> busybox eat 300 Kb ?

Use pmap to find out.

sample_pmap.sh:

#!/bin/sh
./busybox sleep 10 &
pid=$!
sleep 1
size busybox
pmap $pid | env - grep "^[0-9a-f][0-9a-f]* " | sort -r -t " " -k2,999

Sample output from current svn (statically built against uclibc):

   text    data     bss     dec     hex filename
 773796    1168   22712  797676   c2bec busybox
08048000      756K r-xp /app/busybox-1.7.0.svn_uc/busybox
08106000       20K rwxp [heap]
08105000        4K rwxp /app/busybox-1.7.0.svn_uc/busybox
ffaeb000        4K rw-p [ stack ]
ffffe000        4K r-xp [vdso]

In other words: each new running busybox instance needs 24kb more memory,
or more (if you run, say, less, it will allocate memory for text buffer).
This does not include kernel-side memory use. I think it's at least 12kb
per process on this box (AMD64 CPU, 64bit kernel+32bit userspace).

756K of code is shared for all running instances. Same for vdso.
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to