How can I find out what RAM a computer system has?

43,014

Yes there is:

sudo lshw -short -C memory

It will output something like this:

H/W path      Class       Description
====================================================
/0/0          memory      106KiB BIOS
/0/4/5        memory      64KiB L1 cache
/0/4/6        memory      1MiB L2 cache
/0/d          memory      3GiB System Memory
/0/d/0        memory      1GiB SODIMM DDR2 Synchronous 667 MHz (1.5 ns)
/0/d/1        memory      2GiB SODIMM DDR2 Synchronous 667 MHz (1.5 ns)

You may also want to take a look at the full output of sudo lshw -short or even sudo lshw to get much more information about your hardware.

My thanks to jet and CYREX for pointing out a much better method:

sudo dmidecode -t memory

Which outputs something like this:

...

Handle 0x000F, DMI type 17, 27 bytes
Memory Device
    Array Handle: 0x000D
    Error Information Handle: No Error
    Total Width: 64 bits
    Data Width: 64 bits
    Size: 2048 MB
    Form Factor: SODIMM
    Set: 1
    Locator: M2
    Bank Locator: Bank 1
    Type: DDR2
    Type Detail: Synchronous
    Speed: 667 MHz (1.5 ns)
    Manufacturer: Mfg 1
    Serial Number: 1234-B1
    Asset Tag: Not Specified
    Part Number: SODIMM001

    ...

This method is based on the Desktop Management Interface:

From 1999, Microsoft required OEMs and BIOS vendors to support the DMI interface/data-set in order to have Microsoft certification.(1)

It should therefore work pretty reliably.

Share:
43,014

Related videos on Youtube

qbi
Author by

qbi

Updated on September 17, 2022

Comments

  • qbi
    qbi over 1 year

    I'm looking for a way to find out what kind of RAM a system has (clocking speed, DDR-X etc.). Is there a specific command for that? I'm only aware of free or lspci which don't offer those things.

  • Oli
    Oli over 13 years
    This depends on the RAM and BIOS to some extent. My memory is reported as 2GiB DIMM 400 MHz (2.5 ns) where yours shows 2GiB SODIMM DDR2 Synchronous 667 MHz (1.5 ns) (so doesn't show the type or speed accurately - It's DDR3 at 200MHz memory clock, 800MHz bus clock)
  • flo
    flo over 13 years
    Good catch. Unfortunately, I think this is as good as it gets.
  • flo
    flo over 13 years
    I'd be cool if someone could add if the second method is any more reliable.
  • Ankur Agarwal
    Ankur Agarwal almost 12 years
    DO dmidecode and lshw work with ARM embedded devices.