From owner-freebsd-questions Thu May 11 0:50: 4 2000 Delivered-To: freebsd-questions@freebsd.org Received: from fedde.littleton.co.us (fedde.littleton.co.us [216.17.174.44]) by hub.freebsd.org (Postfix) with ESMTP id 2B10937B78C for ; Thu, 11 May 2000 00:49:58 -0700 (PDT) (envelope-from cfedde@fedde.littleton.co.us) Received: from fedde.littleton.co.us (localhost [127.0.0.1]) by fedde.littleton.co.us (8.10.0/8.10.0) with ESMTP id e4B7noD00456; Thu, 11 May 2000 01:49:50 -0600 (MDT) Message-Id: <200005110749.e4B7noD00456@fedde.littleton.co.us> To: Gustavo Vieira Goncalves Coelho Rios Cc: freebsd-questions@FreeBSD.ORG Subject: Re: small program is eating my memory. In-Reply-To: <391A2CC2.383E1BCE@tdnet.com.br> From: Chris Fedde Date: Thu, 11 May 2000 01:49:50 -0600 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 11 May 2000 03:45:06 +0000 Gustavo Vieira Goncalves Coelho Rios wrote: +------------------ | While playing a little bit with C, i realized that even small C programs | eat too much memory. | May you, kindly, explaim me what is happenning? How can i optimize it? | I think here is eating too much memory. +------------------ cute little critter. The RSS reported by ps is the kernels idea for the working set for the process. It includes loader and exit code, bindings for shared libraries, and some other fluff and overhead. Static binding changes things a bit. gcc -static a.c ./a.out 1 psg a.out cfedde 439 0.0 0.1 188 80 p7 R+ 1:46AM 0:00.02 ./a.out 1 chris -- Chris Fedde 303 773 9134 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message