How much memory is in the box? (all UNIX, OpenVMS)

How much memory is in this machine?

It would seem that answering this question ought to be easy; it is – but every system has the answer in a different place. Most put an answer of some sort into kernel messages reported by dmesg (AIX apparently does not).

Most systems have a program for system inventory which reports a variety of things, including memory.

Rather than go into great detail about each one, we’ll just put these out there for all of you to reference. Each environment has multiple commands that give available memory; each command is listed below.

Without further ado, here are a few answers to this burning question:

Solaris

  1. dmesg | grep mem
  2. prtdiag | grep Memory
  3. prtconf -v | grep Memory

AIX

  1. bootinfo -r
  2. lsattr -E1 sys0 -a realmem
  3. getconf REAL_MEMORY

HPUX

  1. dmesg | grep Physical
  2. /opt/ignite/bin/print_manifest | grep Memory
  3. machinfo | grep Memory

Linux

  1. dmesg | grep Memory
  2. grep -i memtotal /proc/meminfo
  3. free

OpenVMS

  1. show mem /page

Update:

FreeBSD

  1. dmesg | grep memory
  2. grep memory /var/run/dmesg.boot
  3. sysctl -a | grep mem
About these ads

6 Responses to How much memory is in the box? (all UNIX, OpenVMS)

  1. Court says:

    Sorry for the uber number of posts today. But if anyone is interested there is a c file on itrc that can be compiled to get some good memory info on hpux. Here is a link:

    http://forums13.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1234982141646+28353475&threadId=1180784

    You want the file memdetail.c

  2. kdknigga says:

    If you have OnlineDiag installed on your HP-UX box (and I really can’t think of why you wouldn’t), this is pretty handy in seeing memory information:

    echo “selclass qualifier memory;info;wait;infolog” | /usr/sbin/cstm

    • ddouthitt says:

      I’d forgotten that utility. This information also can be gotten from /usr/sbin/mstm (text menu driven) and /usr/sbin/xstm (X display). I’m not sure if the others are scriptable like this; I think they may all be the same binary.

  3. Kent says:

    AIX:
    lsattr -E1 sys0 -a realmem
    should not be a 1, but rather:
    lsattr -El sys0 -a realmem

  4. Jan Ives says:

    Linux
    cat /proc/meminfo

  5. Georg says:

    If you are running a non-PAE kernel the mentioned Linux commands don’t give you the full picture.
    In that case you can try to make sense of the output of
    dmidecode -t memory

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 43 other followers

%d bloggers like this: