Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 03 Nov 2011 11:55:23 -0400
From:      Lowell Gilbert <freebsd-questions-local@be-well.ilk.org>
To:        Jon Schipp <jonschipp@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Check Memory Usage, program like 'free' in Linux
Message-ID:  <44sjm542vo.fsf@be-well.ilk.org>
In-Reply-To: <CAB15j_Dh1nKSvBdy%2Bcj7bt5XBHfEqhAD0c3jMq7hVx1VzFC37A@mail.gmail.com> (Jon Schipp's message of "Thu, 3 Nov 2011 10:06:19 -0400")
References:  <CAB15j_DPjj-kHXBGeGCXTWYt-ZzyYkbxqEdvoVXUgf=6g%2BZQWw@mail.gmail.com> <4EB2965F.1030809@gmail.com> <CAB15j_Dh1nKSvBdy%2Bcj7bt5XBHfEqhAD0c3jMq7hVx1VzFC37A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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?

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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44sjm542vo.fsf>