Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Aug 1999 10:38:40 -0500
From:      Dan Nelson <dnelson@emsphone.com>
To:        "Ronald F. Guilmette" <rfg@monkeys.com>
Cc:        questions@FreeBSD.ORG
Subject:   Re: Per-process memory overhead
Message-ID:  <19990806103840.A68893@dan.emsphone.com>
In-Reply-To: <16692.933931719@monkeys.com>; from "Ronald F. Guilmette" on Fri Aug  6 02:28:39 GMT 1999
References:  <16692.933931719@monkeys.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <unistd.h>
> 
> 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




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