Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Nov 2002 20:01:26 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        dillon@apollo.backplane.com
Cc:        hackers@FreeBSD.ORG
Subject:   Re: cvs commit: src/bin/sleep sleep.c
Message-ID:  <20021116.200126.81091323.imp@bsdimp.com>
In-Reply-To: <200211170158.gAH1wJhc035731@apollo.backplane.com>
References:  <200211152017.gAFKHbFS044142@apollo.backplane.com> <20021116.174331.28768088.imp@bsdimp.com> <200211170158.gAH1wJhc035731@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <200211170158.gAH1wJhc035731@apollo.backplane.com>
            Matthew Dillon <dillon@apollo.backplane.com> writes:
:     Take /bin/csh (aka tcsh) for example.
: 
:     Startup overhead if static:	144 pages faults, 113 zero fill, 64 COW
:     Startup overhead if dynamic: 310 page faults, 131 zero fill, 84 COW
: 
:     So the difference is 38 pages of memory = 152KB per instance.  
:     That's fairly significant on a multi-user system that might have
:     several hundred csh's running.  I specifically compile certain
:     non-forked binaries on my system static precisely to reduce their
:     memory footprint.

I just ran a quick test on my systems here.  It looks like two
identical systems give results that are approximately:

                      VSZ  RSS
dynamic:
root 79054  1.3  2.5  1952 1524  pa  S     2:56AM   0:00.13 tcsh
static:
root 38788  0.0  0.1  1324  908  pi  S     7:53PM   0:00.03 tcsh

which actually is a little more than the numbers that you quoted above
(this is 4.5-release + a couple of tweaks).  These were run 3 minutes
apart on machines in different timezone and were for just the login
case.  So it does look like there's more of a penalty for this than I
would have otherwise expected.  I don't know how much of the VSZ is
shared with other processes in the dynamic case.

When I run tcsh, I see a reduction by 592k of memory fre that vmstat
reports in the dynamic case and a 532k reduction in that same
parameter in the static case, so maybe someting is exagerating the
difference between the two in the ps stats.  Or maybe something else
ran on the static system (since it is used for other things)...

Warner

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021116.200126.81091323.imp>