From owner-freebsd-questions Fri Aug 6 8:39:51 1999 Delivered-To: freebsd-questions@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id 9E34514D00 for ; Fri, 6 Aug 1999 08:39:49 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.9.3/8.9.3) id KAA69260; Fri, 6 Aug 1999 10:38:40 -0500 (CDT) (envelope-from dan) Date: Fri, 6 Aug 1999 10:38:40 -0500 From: Dan Nelson To: "Ronald F. Guilmette" Cc: questions@FreeBSD.ORG Subject: Re: Per-process memory overhead Message-ID: <19990806103840.A68893@dan.emsphone.com> References: <16692.933931719@monkeys.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i In-Reply-To: <16692.933931719@monkeys.com>; from "Ronald F. Guilmette" on Fri Aug 6 02:28:39 GMT 1999 X-OS: FreeBSD 4.0-CURRENT Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In the last episode (Aug 06), Ronald F. Guilmette said: > Can someone please explain to me why the following trivial program > shows up on both a `ps' listing and also when using `top' as having > a size of 136 KB? > > #include > > int main (int argc, char *argv[]) { sleep (60); return 0; } > > Using the `size' command, the program itself, even when linked (with > the shared libraries) only has a trivial size of around 8 KB. > > So where the dickens is that other 128 KB of per-process overhead > coming from? Are you sure it's really per-process overhead? It's probably just part of libc or some other shared library. If I link your program static, I see an RSS of 20. > Note: This is NOT just an academic question. I need to run a LOT of > identical (small) processes, and this overhead is killing me bacuse I > really do not have enormous amounts of main memory available. If they really are identical, then you shuld simply worry about memory usage inside your program, since the memory pages holding the executable itself will be shared between all of the processes. -- Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message