24

As per the title:

How can I tell how much RAM is installed on a FreeBSD server?

Thanks!

Ben
  • 395
  • 1
  • 4
  • 7

6 Answers6

50
sysctl hw.physmem
sh-beta
  • 6,756
  • 7
  • 46
  • 65
20

I usually look it up through dmesg messages, like

su-3.2# grep memory /var/run/dmesg.boot 
usable memory = 8571846656 (8174 MB)
avail memory  = 8270299136 (7887 MB)
su-3.2#
alexus
  • 12,342
  • 27
  • 115
  • 173
6

A quick and dirty way is to run the "top" utility.

kmarsh
  • 3,103
  • 15
  • 22
6

If you want to know the size and count of memory sticks in the machine, install dmidecode from the ports tree. It will read the DMI information from the Motherboard and give you lots of hardware configuration information.

Walter
  • 1,047
  • 7
  • 14
1

OS: FreeBSD 11.2-RELEASE-p11

sysctl -n hw.physmem | awk '{ byte =$1 /1024/1024/1024; print byte " GB" }'

-n - Show only variable values
-h - Human readable (without awk, because comma as separator)

Output: 255.854 GB

0

I use the free -m command on Linux. Here is an article on different ways of getting this, including a FreeBSD replacement for the free command: http://www.cyberciti.biz/faq/freebsd-command-to-get-ram-information/

Jess
  • 473
  • 1
  • 6
  • 16
  • 2
    Please make sure to always include the important bits in your answer when citing external sources — after all, the external site might vanish and make your link-only answer useless. – n.st Jun 01 '17 at 20:27