From owner-freebsd-questions@FreeBSD.ORG Thu Nov 3 15:55:26 2011 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 C48A51065674 for ; Thu, 3 Nov 2011 15:55:26 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from asbnvacz-mailrelay01.megapath.net (asbnvacz-mailrelay01.megapath.net [207.145.128.243]) by mx1.freebsd.org (Postfix) with ESMTP id 7D7B18FC13 for ; Thu, 3 Nov 2011 15:55:26 +0000 (UTC) Received: from mail6.sea5.speakeasy.net (mail6.sea5.speakeasy.net [69.17.117.50]) by asbnvacz-mailrelay01.megapath.net (Postfix) with ESMTP id D1C8CA716E2 for ; Thu, 3 Nov 2011 11:55:25 -0400 (EDT) Received: (qmail 5522 invoked from network); 3 Nov 2011 15:55:25 -0000 Received: by simscan 1.4.0 ppid: 2987, pid: 8129, t: 0.1809s scanners: clamav: 0.88.2/m:52/d:10739 Received: from dsl092-078-145.bos1.dsl.speakeasy.net (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail6.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 3 Nov 2011 15:55:24 -0000 Received: by be-well.ilk.org (Postfix, from userid 1147) id C0B722E0EA; Thu, 3 Nov 2011 11:55:23 -0400 (EDT) From: Lowell Gilbert To: Jon Schipp References: <4EB2965F.1030809@gmail.com> Date: Thu, 03 Nov 2011 11:55:23 -0400 In-Reply-To: (Jon Schipp's message of "Thu, 3 Nov 2011 10:06:19 -0400") Message-ID: <44sjm542vo.fsf@be-well.ilk.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-questions@freebsd.org Subject: Re: Check Memory Usage, program like 'free' in Linux X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Nov 2011 15:55:26 -0000 Jon Schipp writes: > On Thu, Nov 3, 2011 at 9:25 AM, Rares Aioanei wrote: > >> On 11/03/2011 03:18 PM, Jon Schipp wrote: >> >>> Is there a program to check physical memory usage in FreeBSD(using 8.2 >>> RELEASE)? >>> In vain of 'free' in Linux. >>> >>> I know you can check the values with sysctl, I was just checking if anyone >>> has a "cleaner" option. >>> I was always curious. >>> >>> Thanks >>> Jon >>> ______________________________**_________________ >>> 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 " >>> >>> top? >> > > Crap, I forgot mention that it needs to be non-interactive, it will be for > e-mail alerts. > > So that rules out top as for as I know. No, you could script it out of top(1), but I'm going to guess that you're trying to be warned when the system is close to running out of memory. That is silly -- you paid for the memory; why would you *want* it to sit around doing nothing? Also note that the definition of "free" is somewhat complicated. Maybe if you described the actual problem you want to solve, we could suggest a more appropriate answer. A literal answer to your question might be: top -d 1|grep '^Mem:'|cut -d ',' -f 6 assuming the format of the line of top doesn't change.