If you need a quick way to find out how much RAM your Linux system supports or to determine the number of DIMM slots available, you can use a command line tool called "dmidecode".
To find out the maximum RAM capacity and the number of RAM slots available, use the following command:
sudo dmidecode -t 16
The output should look something like this:
# dmidecode 2.11
SMBIOS 2.6 present.
Handle 0x0032, DMI type 16, 15 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: 4
The "Maximum Capacity" is the maximum RAM supported by your system, while "Number of Devices" is the number of memory (DIMM) slots available on your computer.
To see complete memory information, including the info above along with currently installed memory information (RAM speed, size, etc.), use:
sudo dmidecode -t memory
Here's an example output for the command above:
# dmidecode 2.11
SMBIOS 2.6 present.
Handle 0x0032, DMI type 16, 15 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: 4
Handle 0x0033, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 2048 MB
Form Factor: SODIMM
Set: None
Locator: ChannelA-DIMM0
Bank Locator: BANK 0
Type: DDR3
Type Detail: Synchronous
Speed: 1333 MHz
Manufacturer: Samsung
Serial Number: 7732E9D6
Asset Tag: 9876543210
Part Number: M471B5773DH0-CH9
Rank: Unknown
Handle 0x0035, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
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: Not Specified
Serial Number: Not Specified
Asset Tag: 9876543210
Part Number: Not Specified
Rank: Unknown
Handle 0x0036, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
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: 1333 MHz
Manufacturer: 830B
Serial Number: A74D1715
Asset Tag: 9876543210
Part Number: NT4GC64B8HG0NS-CG
Rank: Unknown
Handle 0x0038, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
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: Not Specified
Serial Number: Not Specified
Asset Tag: 9876543210
Part Number: Not Specified
Rank: Unknown
You can also use lshw (among others) for this (firstly, install it; in Ubuntu: "sudo apt-get install lshw):
sudo lshw -C memory
It's important to note that Dmidecode reports system hardware information as described in the BIOS and does not scan your hardware, so in some cases the output can be wrong. Running dmidecode on my Dell XPS L702X non-3D laptop, the output says my system should have 4 RAM slots but in fact there are only 2 and only the 3D version of my laptop can have 4 RAM slots (and by the way, there are some Windows applications reporting the same thing), however, the command is accurate about it supporting 16 GB of RAM.
Also see: How To Get Hardware Information In Linux