How to find number of RAM Slots in Linux


Random Access Memory (RAM) is an essential component of any computer system. It stores data that processor uses frequently to speed up processing of programs and applications. As number of RAM slots available on a computer determines maximum amount of RAM that can be installed, it is important to know number of RAM slots on a computer system. In this article, we will discuss how to find number of RAM slots in Linux.

  • Why do you need to know number of RAM slots in Linux?

  • How to find number of RAM slots in Linux a. Using dmidecode command b. Using lshw command c. Using hwinfo command

  • Conclusion

  • Why do you need to know number of RAM slots in Linux?

Why do you need to know number of RAM slots in Linux?

The amount of RAM installed on a computer determines how many programs can be run simultaneously and how quickly they will respond. If you have a limited amount of RAM, your computer will slow down and become less responsive. Additionally, if you have extra RAM slots available on your computer, you can add more RAM to increase your system's performance.

Knowing number of RAM slots on your computer is essential when you are planning to upgrade your computer's memory. If you don't know number of RAM slots available on your computer, you may purchase wrong type of RAM or purchase wrong amount of RAM for your computer.

How to find number of RAM slots in Linux

There are several ways to find number of RAM slots in Linux. We will discuss three methods using dmidecode command, lshw command, and hwinfo command.

Using dmidecode command

The dmidecode command is a Linux command that displays system's hardware information, including number of RAM slots available on a computer. Here are steps to use dmidecode command −

  • Step 1 − Open terminal on your Linux system.

  • Step 2 − Type following command and press Enter −

sudo dmidecode --type memory
  • Step 3 − command will display detailed information about memory installed on your computer, including number of RAM slots available. Look for following information in command output −

Number Of Devices: 4

In this example, there are four RAM slots available on computer.

Using lshw command

The lshw command is another Linux command that displays detailed information about system's hardware, including number of RAM slots available on a computer. Here are steps to use lshw command −

  • Step 1 − Open terminal on your Linux system.

  • Step 2 − Type following command and press Enter −

sudo lshw -short -C memory
  • Step 3 − command will display a list of memory devices on your computer, including number of RAM slots available. Look for following information in command output −

H/W path         Device      Class          Description
=========================================================
/0/1/0          /0/1        memory         64KiB BIOS
/0/1/1          /0/2        memory         32GiB System Memory
/0/1/1/0        /0/3        memory         8GiB DIMM DDR4 Synchronous 3200 MHz (0.3 ns)
/0/1/1/1        /0/4        memory         8GiB DIMM DDR4 Synchronous 3200 MHz (0.3 ns)
/0/1/1/2        /0/5        memory         8GiB DIMM DDR4 Synchronous 3200 MHz

In this example, there are two RAM slots available on computer, and each slot has a 16GB DDR4 RAM installed.

Using hwinfo command

The hwinfo command is a Linux command that displays detailed information about system's hardware, including number of RAM slots available on a computer. Here are steps to use hwinfo command −

  • Step 1 − Open terminal on your Linux system.

  • Step 2 − Type following command and press Enter −

sudo hwinfo --memory
  • Step 3 − command will display detailed information about memory devices on your computer, including number of RAM slots available. Look for following information in command output −

Memory Device: #0
   Form Factor: DIMM
   Type: DDR4
   Type Detail: Synchronous
   Speed: 3200 MT/s
   Manufacturer: Kingston
   Serial Number: 12345678
   Asset Tag: Not Specified
   Part Number: KHX3200C16D4/8G
   Rank: 1
   Configured Memory Speed: 3200 MT/s
   Minimum Voltage: Unknown
   Maximum Voltage: Unknown
   Configured Voltage: Unknown

Memory Device: #1
   Form Factor: DIMM
   Type: DDR4
   Type Detail: Synchronous
   Speed: 3200 MT/s
   Manufacturer: Kingston
   Serial Number: 87654321
   Asset Tag: Not Specified
   Part Number: KHX3200C16D4/8G
   Rank: 1
   Configured Memory Speed: 3200 MT/s
   Minimum Voltage: Unknown
   Maximum Voltage: Unknown
   Configured Voltage: Unknown
Handle 0x0026, DMI type 16, 23 bytes
Physical Memory Array
   Location: System Board Or Motherboard
   Use: System Memory
   Error Correction Type: None
   Maximum Capacity: 64 GB
   Error Information Handle: Not Provided
   Number Of Devices: 4

In this example, command output shows that there are two memory devices (RAM sticks) installed, which means that there are two RAM slots available on computer.

Conclusion

Finding number of RAM slots on your Linux system is crucial when you are planning to upgrade your computer's memory. dmidecode, lshw, and hwinfo commands are excellent tools to display detailed information about memory devices installed on your computer, including number of RAM slots available. By following steps outlined in this article, you can quickly determine number of RAM slots on your Linux system and plan your memory upgrade accordingly.

Updated on: 24-Mar-2023

6K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements