Friday, March 1, 2013

Discover how much memory is installed in OSX from the terminal

Today I was sitting SSHed into an OSX box and needed to know how much RAM was physically installed in the machine. Top of course told me how much RAM was in use however finding the installed RAM took me a few minutes longer than I would have liked.

So this is a note to myself for next time, use the following:

trastle$ system_profiler |  grep -A 9 "BANK [0-9]/DIMM[0-9]"
        BANK 0/DIMM0:

          Size: 2 GB
          Type: DDR3
          Speed: 1333 MHz
          Status: OK
          Manufacturer: 0x80AD
          Part Number: 0x484D54333235533642465238432D48392020
          Serial Number: 0xDEADBEEF

        BANK 1/DIMM0:

          Size: 2 GB
          Type: DDR3
          Speed: 1333 MHz
          Status: OK
          Manufacturer: 0x80AD
          Part Number: 0x484D54333235533642465238432D48392020
          Serial Number: 0xDEADBEEF

Have fun!

2 comments:

Dave Hay said...

Excellent, good tip. For me, I have: -

$ system_profiler | grep -A 9 "BANK [0-9]/DIMM[0-9]"
2013-03-01 09:52:16.831 system_profiler[15041:707] httpdEnabled is deprecated !!
BANK 0/DIMM0:

Size: 8 GB
Type: DDR3
Speed: 1600 MHz
Status: OK
Manufacturer: 0x80AD
Part Number: 0x484D5434314753364D465238432D50422020
Serial Number: 0x00000000

--
BANK 1/DIMM0:

Size: 8 GB
Type: DDR3
Speed: 1600 MHz
Status: OK
Manufacturer: 0x80AD
Part Number: 0x484D5434314753364D465238432D50422020
Serial Number: 0x00000000

Neil D said...

In the last few versions of OS X system_profiler has defaulted to very verbose output, I like to adjust the detail level. I use ARD to check the configuration on large groups of Macs so anything that speeds up the script helps.
system_profiler -detaillevel mini | grep -A 9 "BANK [0-9]/DIMM[0-9]"
BANK 0/DIMM0:

Size: 4 GB
Type: DDR3
Speed: 1600 MHz
Status: OK
Manufacturer: 0x02FE
Part Number: 0x45424A3431554638424455302D474E2D4620

BANK 1/DIMM0:

Size: 4 GB
Type: DDR3
Speed: 1600 MHz
Status: OK
Manufacturer: 0x02FE
Part Number: 0x45424A3431554638424455302D474E2D4620

If I just want to know the total RAM installed and not the configuration I use.

system_profiler -detaillevel mini | grep -A 12 'Hardware Overview' | grep 'Memory'
Memory: 8 GB

Post a Comment