How do I determine the number of RAM slots in use?
I forgot how many RAM (DIMM) modules are installed on my laptop. I do not want to unscrew it but want to look it up on the console using bash. How do I gather this information?
Since you don’t mention, I’m assuming this is on Linux. Any of the following should show you (with root):
dmidecode -t memory
dmidecode -t 16
lshw -class memory
In my case,
sudo dmidecode -t 16
reports this:
Handle 0x000A, DMI type 16, 23 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: None
Maximum Capacity: 16 GB
Error Information Handle: Not Provided
Number Of Devices: 2
I would like to point out that I have only 4 GiB of RAM in one module. That info is shown by doing:
sudo dmidecode -t 17
this is shown:
# dmidecode 2.11
SMBIOS 2.7 present.
Handle 0x000B, DMI type 17, 34 bytes
Memory Device
Array Handle: 0x000A
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: ChannelA-DIMM0
Bank Locator: BANK 0
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: None
Part Number: Not Specified
Rank: Unknown
Configured Clock Speed: Unknown
Handle 0x000C, DMI type 17, 34 bytes
Memory Device
Array Handle: 0x000A
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 4096 MB
Form Factor: SODIMM
Set: None
Locator: ChannelB-DIMM0
Bank Locator: BANK 2
Type: DDR3
Type Detail: Synchronous
Speed: 1600 MHz
Manufacturer: Hynix/Hyundai
Serial Number: 11111111
Asset Tag: None
Part Number: HMT351S6CFR8C-PB
Rank: Unknown
Configured Clock Speed: 1600 MHz
And, as you can see, Bank 2 is full and Bank 0 empty. Board has only two slots for RAM, but they have to be double channel.
Let’s make it easy for the not so shell-savvy users:
sudo dmidecode -t memory | grep -i size
The output on my laptop would be:
Size: 2048 MB
Size: 1024 MB
…showing that I have one 1GB module and one 2GB module installed.
Even though the OP prefers to avoid unscrewing to physically inspect, I strongly suggest everyone do just that since the answer back from command line probes can be misleading. On my laptop, command line probes say I have 4 slots (2 used, 2 empty), yet upon unscrewing I actually have 2 slots (perhaps I have 2 hidden slots elsewhere yet not visible removing bottom panel) :
sudo dmidecode | grep -A 9 "System Information"
System Information
Manufacturer: Micro-Star International Co., Ltd.
Product Name: CX61 0NC/CX61 0ND/CX61 0NF/CX61 0NE
Version: REV:1.0
Serial Number: FFFFFFFF
UUID: 03000200-0400-0500-0006-000700080009
Wake-up Type: Power Switch
SKU Number: To be filled by O.E.M.
Family: To be filled by O.E.M.
# -------
sudo dmidecode -t 16
# dmidecode 2.12
SMBIOS 2.7 present.
Handle 0x0024, DMI type 16, 23 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: None
Maximum Capacity: 32 GB
Error Information Handle: Not Provided
Number Of Devices: 4
# -------
sudo dmidecode -t 17
# dmidecode 2.12
SMBIOS 2.7 present.
Handle 0x0025, DMI type 17, 34 bytes
Memory Device
Array Handle: 0x0024
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 4096 MB
Form Factor: SODIMM
Set: None
Locator: ChannelA-DIMM0
Bank Locator: BANK 0
Type: DDR3
Type Detail: Synchronous
Speed: 1600 MHz
Manufacturer: 830B
Serial Number: 91D82E7B
Asset Tag: 9876543210
Part Number: M2S4G64CB8HG4N-DI
Rank: 2
Configured Clock Speed: 1600 MHz
Handle 0x0027, DMI type 17, 34 bytes
Memory Device
Array Handle: 0x0024
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: ChannelA-DIMM1
Bank Locator: BANK 1
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: [Empty]
Serial Number: [Empty]
Asset Tag: 9876543210
Part Number: [Empty]
Rank: Unknown
Configured Clock Speed: Unknown
Handle 0x0028, DMI type 17, 34 bytes
Memory Device
Array Handle: 0x0024
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 4096 MB
Form Factor: SODIMM
Set: None
Locator: ChannelB-DIMM0
Bank Locator: BANK 2
Type: DDR3
Type Detail: Synchronous
Speed: 1600 MHz
Manufacturer: 830B
Serial Number: 20DC2E7C
Asset Tag: 9876543210
Part Number: M2S4G64CB8HG4N-DI
Rank: 2
Configured Clock Speed: 1600 MHz
Handle 0x002A, DMI type 17, 34 bytes
Memory Device
Array Handle: 0x0024
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: ChannelB-DIMM1
Bank Locator: BANK 3
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: [Empty]
Serial Number: [Empty]
Asset Tag: 9876543210
Part Number: [Empty]
Rank: Unknown
Configured Clock Speed: Unknown
ubuntu 14.04
[root@kr0 ~]# lsmem
RANGE SIZE STATE REMOVABLE BLOCK
0x0000000040000000-0x000000063fffffff 24G online yes 1-24
Memory block size: 1G
Total online memory: 24G
Total offline memory: 0B