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?
5 Answers
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
-
18
-
16
-
@HSchmale, right, without sudo it doesn't give a very detailed report. Just the basic stuff.– alfCCommented Jan 5, 2018 at 6:53
-
2
dmidecode -t memory
is equivalent todmidecode -t 5,6,16,17
.– cezarCommented Jun 21, 2020 at 10:25 -
2Thanks! The
lshw -class memory
produced most human readable results. Commented Feb 11, 2021 at 16:10
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.
-
-
1sudo dmidecode -t memory | grep -E '^\s+Size:' is a bit better theses days– balderCommented Mar 29, 2023 at 18:07
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.
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
-
Where do you see 4 installed modules? -t 17 clearly shows 2 modules of 4GB each, and 2 unused (and probably unimplemented) slots.– Dani_lCommented Oct 3, 2015 at 1:12
-
@Dani_l, can you elaborate on what "No Module Installed" mean I would think it means you have a place to stick your ram that seems to be empty, but that seems to not be the case for OP... could you elaborate so us mere mortals understand– azoriusCommented Mar 16, 2016 at 11:33
-
5@azorius
(and probably unimplemented)
means the bios/chipset can handle 4 slots, but the board manufacturer decided not to include 2 of the possible slots the bios can support in the physical realm that is the actual MB. Since dmidecode talks to the bios, rather than the actual physical screws,bolts and glue, it only knows what's in the dmi table - which is that it can handle 4 slots, but for 2 of them there is no info, so the assumption is that they are merely uninstalled, rather than non-existing.– Dani_lCommented Mar 16, 2016 at 15:43
[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