Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Nov 2011 12:22:20 -0400
From:      Jon Schipp <jonschipp@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Check Memory Usage, program like 'free' in Linux
Message-ID:  <CAB15j_DERXo%2BB48s7E=JJDQ%2BQwTSyPw5tiscXUdFHa5XG6WNRQ@mail.gmail.com>
In-Reply-To: <44sjm542vo.fsf@be-well.ilk.org>
References:  <CAB15j_DPjj-kHXBGeGCXTWYt-ZzyYkbxqEdvoVXUgf=6g%2BZQWw@mail.gmail.com> <4EB2965F.1030809@gmail.com> <CAB15j_Dh1nKSvBdy%2Bcj7bt5XBHfEqhAD0c3jMq7hVx1VzFC37A@mail.gmail.com> <44sjm542vo.fsf@be-well.ilk.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Nov 3, 2011 at 11:55 AM, Lowell Gilbert <
freebsd-questions-local@be-well.ilk.org> wrote:

> Jon Schipp <jonschipp@gmail.com> writes:
>
> > On Thu, Nov 3, 2011 at 9:25 AM, Rares Aioanei <bsdlisten@gmail.com>
> 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 <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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAB15j_DERXo%2BB48s7E=JJDQ%2BQwTSyPw5tiscXUdFHa5XG6WNRQ>