From owner-freebsd-hackers Tue Oct 31 10:48:19 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from earth.backplane.com (placeholder-dcat-1076843399.broadbandoffice.net [64.47.83.135]) by hub.freebsd.org (Postfix) with ESMTP id 96DC337B4D7 for ; Tue, 31 Oct 2000 10:48:16 -0800 (PST) Received: (from dillon@localhost) by earth.backplane.com (8.11.1/8.9.3) id e9VIlev20173; Tue, 31 Oct 2000 10:47:40 -0800 (PST) (envelope-from dillon) Date: Tue, 31 Oct 2000 10:47:40 -0800 (PST) From: Matt Dillon Message-Id: <200010311847.e9VIlev20173@earth.backplane.com> To: Les Biffle Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Runtime memory footprint References: <200010311817.LAA90886@ns3.safety.net> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :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