How to check for memory on FreeBSD
In Linux, you can easily check memory information using the free command which parse the /proc/meminfo.
However on FreeBSD, there is no such command and its a bit difficult getting a simple command to check memory information on your FreeBSD server.
In this article, we look at two ways you can check your memory information
1. check the dmesg kernel ring buffer
dmesg | grep -i memory
output should be similar to the below:
real memory = 1073741824 (1024 MB) avail memory = 1001308160 (954 MB)
2. Install a utility called freecolor
pkg install freecolor
or if you are using port collecion:
cd /usr/ports/sysutils/freecolor/ make && make clean
You can check memory information by the command below:
freecolor -m
Apart from the above, you can also use check from using the sysctl utility which retrieves kernel state
sysctl -a | grep -i hw.*mem
However, this is not easily readable as compared to the two options mentioned above.