From owner-freebsd-questions@FreeBSD.ORG Thu Nov 3 16:22:22 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 4D5AA106566C for ; Thu, 3 Nov 2011 16:22:22 +0000 (UTC) (envelope-from jonschipp@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id D0ABB8FC12 for ; Thu, 3 Nov 2011 16:22:21 +0000 (UTC) Received: by faar19 with SMTP id r19so2554384faa.13 for ; Thu, 03 Nov 2011 09:22:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=RGEdkJoHBwRWC7QxD51lG08CHn0tnrZwfYOcyCiKHJE=; b=NRgmERwv4RvNFil6a8sy6viOAjl/Ebij6bhiJLIojvjAAeHI1rtTJj8drO2t++a86n sl4gKrfziQL2nL0yptWFwhDp/ZYuj2Y+MuppnaalZ9TgVEY8bBVVBhSoANAwuuXpzds7 6PdYpLZdlSsXWqoGqYf3ZQiMe9Pb0lNDY4WEY= MIME-Version: 1.0 Received: by 10.223.81.196 with SMTP id y4mr17530173fak.6.1320337340578; Thu, 03 Nov 2011 09:22:20 -0700 (PDT) Received: by 10.152.24.74 with HTTP; Thu, 3 Nov 2011 09:22:20 -0700 (PDT) In-Reply-To: <44sjm542vo.fsf@be-well.ilk.org> References: <4EB2965F.1030809@gmail.com> <44sjm542vo.fsf@be-well.ilk.org> Date: Thu, 3 Nov 2011 12:22:20 -0400 Message-ID: From: Jon Schipp To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: Check Memory Usage, program like 'free' in Linux 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: Thu, 03 Nov 2011 16:22:22 -0000 On Thu, Nov 3, 2011 at 11:55 AM, Lowell Gilbert < freebsd-questions-local@be-well.ilk.org> wrote: > 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< > 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? > While this isn't my intention... I'm curious: You wouldn't want to know when your machine has reached periods of high memory utilization? Occurrence/frequency information seems pretty valuable. More importantly, at specific times, noticing patterns, use during/after business hours If you didn't want to use memory, it wouldn't be purchased. I don't think keeping track of the utility of your purchases is silly. 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. > That does the trick. I didn't think it was possible to grab data from interactive programs without throwing in some "garbage". Should've tested. Thanks