You want to upgrade the Memory to your newly purchased Computer or your old system, and you have no idea about the maximum supported RAM by your system, what will you do? Of course, you can get the specifications from the system catalog, manuals, and also from the system vendor's website. But, it is not necessary. Here is two methods to find out maximum supported RAM in Linux from command line.
Please note that this is not about how much RAM the Linux OS supports, but how much your motherboard supports.
1. Find Out Maximum Supported RAM In Linux using Dmidecode
From the man pages, Dmidecode is a tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. Using Dmidecode, you can retrieve this information without having to probe for the actual hardware.
Dmidecode is available in most Linux distribution's default repositories.
To install it in Arch Linux and its derivatives, run:
$ sudo pacman -S dmidecode
On Debian/Ubuntu/Linux Mint:
$ sudo apt-get install dmidecode
On Fedora / RHEL / CentOS / AlmaLinux / Rocky Linux:
$ sudo yum install dmidecode
$ sudo dnf install dmidecode
$ sudo zypper in dmidecode
Once Dmicode installed, run the following command to find out maximum supported RAM by your system:
$ sudo dmidecode -t 16
# dmidecode 3.0 Getting SMBIOS data from sysfs. SMBIOS 2.6 present. Handle 0x0014, 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: 2
As you see in the above output, the maximum supported RAM size is 16 GB, and the number of available RAM slots (DIMM) are 2.
You might want to check the currently installed RAM size. To do so, run:
$ sudo dmidecode -t 17
Getting SMBIOS data from sysfs. SMBIOS 2.6 present. Handle 0x0017, DMI type 17, 28 bytes Memory Device Array Handle: 0x0014 Error Information Handle: 0x0000 Total Width: Unknown Data Width: Unknown Size: No Module Installed Form Factor: DIMM Set: None Locator: DIMM_B Bank Locator: BANK 2 Type: Unknown Type Detail: None Speed: Unknown Manufacturer: Not Specified Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Rank: Unknown Handle 0x0015, DMI type 17, 28 bytes Memory Device Array Handle: 0x0014 Error Information Handle: 0x0000 Total Width: 64 bits Data Width: 64 bits Size: 4096 MB Form Factor: SODIMM Set: None Locator: DIMM_A Bank Locator: BANK 0 Type: DDR3 Type Detail: Synchronous Speed: 1067 MHz Manufacturer: 014F Serial Number: 00092AF2 Asset Tag: 54114000 Part Number: JM1066KSN-4G Rank: Unknown
As you see in the output, my system has two DIMM slots and 4 GB RAM is installed in one slot. My RAM type is DDR3 and speed is 1067 MHz. The other one is empty.
Alternatively, run any one of the following command to display your system's Memory details.
$ sudo dmidecode -t memory
# dmidecode 3.0 Getting SMBIOS data from sysfs. SMBIOS 2.6 present. Handle 0x0014, 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: 2 [...]
To view the complete system hardware details, just run:
$ sudo dmidecode
Please note that some chipset and BIOS may not provide accurate information. However, you might get quite accurate details from server grade hardware.
For more details, refer man pages.
$ man dmidecode
2. Find Maximum Supported RAM In Linux using Memconf
Memconf is a simple perl script that displays memory modules installed in a Linux, Unix, Sun/Oracle Solaris, and HP-UX system.
Make sure you have installed perl before using this script.
To install perl on Arch Linux and its derivatives, run:
$ sudo pacman -S perl
On Debian / Ubuntu / Linux Mint:
$ sudo apt-get install perl
On RHEL / Fedora / CentOS / Scientific Linux:
$ sudo yum install perl
$ sudo dnf install perl
After installing perl, download memconf script using command:
$ wget https://sourceforge.net/projects/memconf/files/V3.12/memconf-v3.12.pl.gz
Extract the zip using command:
$ gunzip memconf-v3.12.pl.gz
Finally, run memconf script as shown below.
$ sudo perl memconf-v3.12.pl
memconf: V3.12 07-Oct-2016 http://sourceforge.net/projects/memconf/ hostname: sk Dell Inc. Inspiron N5050 (Dual-Core Hyper-Threaded Intel(R) Core(TM) i3-2350M @ 2.30GHz) Memory Error Correction: None Maximum Memory: 16384MB (16GB) DIMM_A BANK 0: 4096MB 1067MHz Synchronous DDR3 SODIMM, AMD JM1066KSN-4G empty memory sockets: DIMM_B BANK 2 total memory = 4096MB (4GB)
As you see above, the maximum supported memory is 16 GB.
For more details, refer memconf homepage.