From owner-freebsd-questions@FreeBSD.ORG Mon May 8 00:43:54 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 13C7916A423 for ; Mon, 8 May 2006 00:43:54 +0000 (UTC) (envelope-from michal.mertl@i.cz) Received: from vidle.i.cz (vidle.i.cz [193.179.36.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8261A43D6E for ; Mon, 8 May 2006 00:43:50 +0000 (GMT) (envelope-from michal.mertl@i.cz) Received: from ns.i.cz (brana.i.cz [193.179.36.134]) by vidle.i.cz (Postfix) with ESMTP id 5E3041CC0C; Mon, 8 May 2006 02:43:49 +0200 (CEST) Received: from localhost (localhost.i.cz [127.0.0.1]) by ns.i.cz (Postfix) with SMTP id 459F8122A02; Mon, 8 May 2006 02:43:49 +0200 (CEST) X-AV-Checked: Mon May 8 02:43:49 2006 ns.i.cz Received: from genius.i.cz (brana.i.cz [192.168.1.10]) by ns.i.cz (Postfix) with ESMTP id 3A821122A01; Mon, 8 May 2006 02:43:49 +0200 (CEST) From: Michal Mertl To: Jonathan Horne In-Reply-To: <200605071219.41408.jhorne@dfwlp.com> References: <200605071209.15390.jhorne@dfwlp.com> <200605071219.41408.jhorne@dfwlp.com> Content-Type: text/plain Date: Mon, 08 May 2006 02:43:40 +0200 Message-Id: <1147049020.6775.19.camel@genius.i.cz> Mime-Version: 1.0 X-Mailer: Evolution 2.4.2.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: memory usage X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 May 2006 00:43:54 -0000 Jonathan Horne wrote: > On Sunday 07 May 2006 12:09, Jonathan Horne wrote: > > i have a server that has 2GB ram, recently upgraded from 1GB ram. it runs > > apache2.0 with php5, sendmail with spamass-milter, dovecot, mysql5.0, > > cacti, and a couple other small things (like snmp, my bx irc shell, etc). > > > > when ever i look at the memory usage (via phpsysinfo, or cacti graphs), its > > nearly always showing less than 100mb of ram available. top shows several > > perls (probably spamassassin), 8 or so httpds (typical), but that would > > probably only account for (a liberal guess) 500-600 mb of ram. > > > > is there a good way to find out where this bottomless ram funnel leads to? > > or, should this behavior just be considered typical? > > > > thanks, > > jonathan > > update... > > i just upgraded to the new phpsysinfo rc2, and it shows more detailed > information about what the memory usage is doing. it shows that 1.57GB is > being used by buffers. what is the significance of 1.57GB of memory being > used by 'buffers'? I would expect a question like this is somewhere in the FAQ. It is typical that you only see a couple of hundred kilobytes of free memory on a (at least a little used) FreeBSD system. The system allocates 'physical' memory as needed (as long as there is some free) and only when there is no free memory, it starts to reuse some of the 'almost' free memory. 'Almost' free memory is mainly disk cache (your buffers). This is nothing to worry about. You can see there is a memory shortage when there is some swapping during normal workload (in top there appears "kb in/out" on the swap line). It is neither anything to worry about when you have some swap space used - FreeBSD is rather aggresively copying parts of memory to swap when it feels to. As long as it doesn't need to use the data in the swap often it's an optimization - even disk cache is better usage of your memory then inactive parts of your programs' memory. Michal