BSD equivalent of Linux's free(1)?

Paul Schmehl pschmehl_lists at tx.rr.com
Wed Aug 18 19:24:23 UTC 2010


--On Wednesday, August 18, 2010 14:14:25 -0400 Aleksandr Miroslav 
<alexmiroslav at gmail.com> wrote:

> On Wed, Aug 18, 2010 at 1:41 PM, RW <rwmaillists at googlemail.com> wrote:
>> Is there any particular reason you want to know? Free memory isn't a
>> very meaningful concept in FreeBSD.
>
> I have a webserver that had it's Apache killed this morning. The box
> itself had been stable for several years, as well as the Apache
> instance. The error that I saw in /var/log/messages was something along
> the following:
>
>     "pid 1234 (httpd), uid 100, was killed: out of swap space"
>
> So I went to check what was eating up the swap,
>
> The problem itself was tracked down fairly easily, someone had added a
> shelt script to cron (/home/user/foo.sh) and had mistakenly put the full
> path to the script into the script itself -- essentially creating a
> forkbomb.
>
> But while I was in the middle of debugging this and noticed that line
> from the logfile, I spent more time than necessary trying to figure out
> exactly how much swap/memory was being used, and who was using it.

man (8) pstat

pstat -s -m
Device          1M-blocks     Used    Avail Capacity
/dev/ad8s1b          8192        0     8191     0%

-- 
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
*******************************************
"It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead." Thomas Jefferson



More information about the freebsd-questions mailing list