From owner-freebsd-questions@FreeBSD.ORG Fri Sep 24 18:46:51 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 90FBD16A4CF for ; Fri, 24 Sep 2004 18:46:51 +0000 (GMT) Received: from advmail.lsn.net (advmail.lsn.net [66.90.138.148]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2FD3243D49 for ; Fri, 24 Sep 2004 18:46:49 +0000 (GMT) (envelope-from norm@etherealconsulting.com) Received: from [127.0.0.1] (24-155-40-125.ip.grandenetworks.net [24.155.40.125]) by advmail.lsn.net (8.12.8/8.12.4) with ESMTP id i8OIkm0A013649; Fri, 24 Sep 2004 13:46:52 -0500 Message-ID: <41546B94.7090508@etherealconsulting.com> Date: Fri, 24 Sep 2004 13:46:44 -0500 From: Norm Vilmer User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Gregor Mosheh References: <20040924165952.62558.qmail@web53808.mail.yahoo.com> In-Reply-To: <20040924165952.62558.qmail@web53808.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiVirus: checked by Vexira Milter 1.0.6; VAE 6.27.0.12; VDF 6.27.0.72 cc: freebsd-questions@freebsd.org Subject: Re: please educate me on memory usage X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2004 18:46:51 -0000 Gregor Mosheh wrote: > I was looking at my top output and was surprised to > see that the bulk of my 512 MB of memory was in use, > since the server really has fairly little running. > It's not a problem, but I was wanting some > clarification on where this memory was being used, for > my own education. > > The original goal was that I had figured that a lot of > memory would be unused since so little is running, and > perhaps I could allocate some more to Postgres. > Apparently nowt, but I don't quite understand all the > intricacies of what *is* using my memory. > > 35 processes: 1 running, 34 sleeping > CPU states: 0.0% user, 0.0% nice, 0.0% system, > 0.0% interrupt, 100% idle > Mem: 158M Active, 207M Inact, 80M Wired, 20M Cache, > 60M Buf, 33M Free > Swap: 2000M Total, 6848K Used, 1994M Free > > So, 158 MB of memory in use. Does that include > anything other than process' memory, e.g. shared > memory, kernel memory, some of the fs buffer? If I add > up the VSZ column from 'ps aux' I get 110 MB. > > The server's only processes of interest are MySQL, > Postgres, and Apache httpd. There are cron, sendmail, > etc. but these are all <1M usage according to both top > and ps. > > MySQL has VSZ 38 MB and RSS 4 MB. > > Postgres (incl stats collectors) has VSZ 25 MB and RSS > <1 MB. There's also the shared memory: ipcs agrees > with my postgresql.conf settings: 2 MB of shared > memory buffers. > > Apache 1.3 has 15 processes, each using 3.6 MB VSZ and > 1.5 MB RSS. I was of the impression that the bulk of > this memory was shared with the parent process, no? > > So where's the rest of the memory going? > > The 80M Wired is interesting, since I don't know where > it's going. I presume that PG's 2 MB of shared buffers > are wired (though I saw an email today that implied > otherwise), but how could I track down the rest of it? > > > > > > __________________________________ > Do you Yahoo!? > Yahoo! Mail is new and improved - Check it out! > http://promotions.yahoo.com/new_mail > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > My guess would be MySQL, however I am no expert. My machine is running apache, ntp, ipfw, and other typical stuff like syslog, sendmail, etc. Mem: 11M Active, 122M Inact, 44M Wired, 28K Cache, 57 Buf, 292M Free. I did optimize my machine using doc's I read on www.FreeBSD.org.