From owner-freebsd-questions@FreeBSD.ORG Wed Aug 18 19:24:22 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFCDB1065698 for ; Wed, 18 Aug 2010 19:24:22 +0000 (UTC) (envelope-from prvs=839c1d97e=pschmehl_lists@tx.rr.com) Received: from ip-002.utdallas.edu (ip-002.utdallas.edu [129.110.20.108]) by mx1.freebsd.org (Postfix) with ESMTP id B049B8FC1A for ; Wed, 18 Aug 2010 19:24:22 +0000 (UTC) X-Group: None X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApgFANvJa0yBbgogUmdsb2JhbACgWQEkQcEchTcEhDE X-IronPort-AV: E=Sophos;i="4.56,228,1280725200"; d="scan'208";a="35978990" Received: from zxtm01.utdallas.edu (HELO utd65257.utdallas.edu) ([129.110.10.32]) by ip-002.utdallas.edu with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Aug 2010 13:55:33 -0500 Date: Wed, 18 Aug 2010 13:55:33 -0500 From: Paul Schmehl To: Aleksandr Miroslav , freebsd-questions@freebsd.org Message-ID: <17B10793E5263A663EE132C9@utd65257.utdallas.edu> In-Reply-To: References: <20100818184148.31442aa9@gumby.homeunix.com> X-Mailer: Mulberry/4.0.6 (Linux/x86) X-Munged-Reply-To: Figure it out MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: Subject: Re: BSD equivalent of Linux's free(1)? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Paul Schmehl List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2010 19:24:23 -0000 --On Wednesday, August 18, 2010 14:14:25 -0400 Aleksandr Miroslav wrote: > On Wed, Aug 18, 2010 at 1:41 PM, RW wrote: >> Is there any particular reason you want to know? Free memory isn't a >> very meaningful concept in FreeBSD. > > I have a webserver that had it's Apache killed this morning. The box > itself had been stable for several years, as well as the Apache > instance. The error that I saw in /var/log/messages was something along > the following: > > "pid 1234 (httpd), uid 100, was killed: out of swap space" > > So I went to check what was eating up the swap, > > The problem itself was tracked down fairly easily, someone had added a > shelt script to cron (/home/user/foo.sh) and had mistakenly put the full > path to the script into the script itself -- essentially creating a > forkbomb. > > But while I was in the middle of debugging this and noticed that line > from the logfile, I spent more time than necessary trying to figure out > exactly how much swap/memory was being used, and who was using it. man (8) pstat pstat -s -m Device 1M-blocks Used Avail Capacity /dev/ad8s1b 8192 0 8191 0% -- Paul Schmehl, Senior Infosec Analyst As if it wasn't already obvious, my opinions are my own and not those of my employer. ******************************************* "It is as useless to argue with those who have renounced the use of reason as to administer medication to the dead." Thomas Jefferson