Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Oct 2000 10:47:40 -0800 (PST)
From:      Matt Dillon <dillon@earth.backplane.com>
To:        Les Biffle <les@ns3.safety.net>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Runtime memory footprint
Message-ID:  <200010311847.e9VIlev20173@earth.backplane.com>
References:   <200010311817.LAA90886@ns3.safety.net>

next in thread | previous in thread | raw e-mail | index | archive | help
:What determines the runtime memory footprint of a process?  I have small
:daemons that occupy 25K on disk, don't malloc anything to speak of, but
:are 440K to 1024K in memory, according to top and ps.  For that matter,
:just about nothing in my "ps" display is under 400K.  The daemons are
:dynamically-linked.  Is there anything I can do to reduce the memory
:footprint?
:
:Thanks and best regards,
:
:-Les
:
:-- 
:Les Biffle             Community Service...  Just Say NO!

    Most of this is from shared libraries.  The processes aren't actually
    eating that much memory.

fire:/home/dillon> fgrep blah
(leave sitting around)

fire:/home/dillon> ps axl | egrep 'RSS|fgrep'
  UID   PID  PPID CPU PRI NI   VSZ  RSS WCHAN  STAT  TT       TIME COMMAND
  101 17341 16524   0   3  0  1036  496 ttyin  S+    p1    0:00.00 fgrep blah
				    ^^^
				496K run size

vmstat 1
before first fgrep is run
 0 0 0  110532 65772    9   0   0   0   6   0   0   0  258  178  53  0  1 99
 1 0 0  110532 65772    9   0   0   0   6   0   0   0  231  100  35  1  1 98
after first fgrep is run
 0 0 0  110964 65636   53   0   0   0   7   0   0   0  313  732 129  2  0 98
 0 0 0  110964 65636    9   0   0   0   6   0   0   0  284  205  53  0  0 100
after second fgrep is run
 0 0 0  111312 65504   52   0   0   0   7   0   0   0  237  282  64  1  1 98
 0 0 0  111312 65504    9   0   0   0   6   0   0   0  435  529 108  1  2 98

    Difference: around 132K less free memory for each instance of fgrep
    that is run.

    So fgrep, with an RSS of 496K, actually only eats up around 132K of
    unsharable ram.

					-Matt



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?200010311847.e9VIlev20173>