What is equivalent of Linux's 'free' command on FreeBSD v8.1?
I am calling 'free' from my application and reporting the results in my application's log file. What would be the replacement when porting to FreeBSD v8.1?
Here is a sample run of 'free' on Linux:
[centos4x32 ~] free
total used free shared buffers cached
Mem: 774452 733044 41408 0 98040 328880
-/+ buffers/cache: 306124 468328
Swap: 2031608 224 2031384
The default command line shell for FreeBSD is tcsh , but some virtual private servers running FreeBSD use another shell (such as sh ) by default. If you'd like to set tcsh as your freebsd user's default shell, run the following command: sudo chsh -s /bin/tcsh freebsd.
The Linux free command outputs a summary of RAM usage, including total, used, free, shared, and available memory and swap space. The command helps monitor resource usage and allows an admin to determine if there's enough room for running new programs. In this tutorial, you will learn to use the free command in Linux.
available memory in Linux is, that free memory is not in use and sits there doing nothing. While available memory is used memory that includes but is not limited to caches and buffers, that can be freed without the performance penalty of using swap space.
vmstat
has default output which is similar in nature and takes many options that give extremely detailed information, eg vmstat -m
swapinfo
would cover the swap parttop -d1
causes top to print one screen and exit, and the banner is very similar to free
. Use top -d1 | head -n 7
to see only the bannerMaybe freecolor
command is a choice. Install it:
# cd /usr/ports/sysutils/freecolor
# make install clean
Use it:
# freecolor
Physical : [#################################..] 94% (1907820/2018396)
Swap : [###################################] 100% (1048540/1048540)
# freecolor -m -o
total used free shared buffers cached
Mem: 1971 107 1863 0 0 0
Swap: 1023 0 1023
Please refer FreeBSD find out RAM size Including Total Amount of Free and Used Memory Size.
vmstat -s
gives some more human-readable or script-parseable information, including listing the page size. Otherwise, it gives output in numbef of pages. With no options, vmstat
gives a brief summary.
The vmstat
command also exists on NetBSD.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With