Wednesday, March 3, 2010

How to know how many slots of memory are used (or free)?

My last linux trouble was  to discover how many memory slots were free in my CPU without opening it.

The solution to this problem comes from Lamarque Souza: 
all you need is to run dmidecode | grep -A 8 'Memory' as root, or on ubuntu:


sudo dmidecode | grep -A 8 'Memory'

Note: For more information remove the -A 8 from the grep command.

If it works correctly you should get something like the below. What you can see is that there are 4 slots for memory, and 2 of them have memory installed ( look at: Memory Device).

Physical Memory Array
    Location: System Board Or Motherboard
    Use: System Memory
    Error Correction Type: None
    Maximum Capacity: 8 GB
    Error Information Handle: Not Provided
    Number Of Devices: 4

Handle 0x0015, DMI type 19, 15 bytes
Memory Array Mapped Address
    Starting Address: 0x00000000000
    Ending Address: 0x000FFFFFFFF
    Range Size: 4 GB
    Physical Array Handle: 0x0014
    Partition Width: 0

Handle 0x0016, DMI type 17, 27 bytes
Memory Device
    Array Handle: 0x0014
    Error Information Handle: Not Provided
    Total Width: 64 bits
    Data Width: 64 bits
    Size: 2048 MB
    Form Factor: DIMM
    Set: None
    Locator: J1MY
--
Memory Device
    Array Handle: 0x0014
    Error Information Handle: Not Provided
    Total Width: 64 bits
    Data Width: 64 bits
    Size: 2048 MB
    Form Factor: DIMM
    Set: None
    Locator: J2MY
--
Memory Device
    Array Handle: 0x0014
    Error Information Handle: Not Provided
    Total Width: Unknown
    Data Width: Unknown
    Size: No Module Installed
    Form Factor: DIMM
    Set: None
    Locator: J3MY
--
Memory Device
    Array Handle: 0x0014
    Error Information Handle: Not Provided
    Total Width: Unknown
    Data Width: Unknown
    Size: No Module Installed
    Form Factor: DIMM
    Set: None
    Locator: J4MY

No comments:

Post a Comment

 
Locations of visitors to this page