Check Memory Usage, program like 'free' in Linux

Lowell Gilbert freebsd-questions-local at be-well.ilk.org
Thu Nov 3 15:55:26 UTC 2011


Jon Schipp <jonschipp at gmail.com> writes:

> On Thu, Nov 3, 2011 at 9:25 AM, Rares Aioanei <bsdlisten at 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 at 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 at freebsd.org <freebsd-questions-unsubscribe at 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.


More information about the freebsd-questions mailing list