How To Plan For Memory Expansion On a Linux Host

This is an user contributed article.

When it is time to upgrade the memory on a Linux host, it is important to understand the existing memory information of the system, which will help to plan the memory upgrade appropriately without opening server chassis (especially, when you have Linux rack mount server).

What is the current total RAM used in the system?

This can be obtained using free command or from the /proc/meminfo file as shown below. In this example, the current RAM is 1GB.
# free
Sample output:

             total       used       free     shared    buffers     cached
Mem:       2074016    2002592      71424          0     480908     937296
-/+ buffers/cache:     584388    1489628
Swap:      1951888      79116    1872772

You can also display memory ram, info using /proc file, enteR:
# grep MemTotal /proc/meminfo
Sample output:

MemTotal:      1034624 kB

What is the maximum RAM supported by the system?

You can use dmidecode command to query all memory related information from the system DMI table. In this example, the maximum RAM supported by the system is 8 GB as shown below.

# dmidecode -t 16
Sample output:

# dmidecode 2.9
SMBIOS 2.3 present.
Handle 0x1000, DMI type 16, 15 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: Multi-bit ECC
Maximum Capacity: 8 GB
Error Information Handle: Not Provided
Number Of Devices: 4

How many memory slots are available for expansion? We know the current memory of the system is 1G. Is this 1 x 1G (or) 2 x 512MB (or) 4 x 256MB? This can be figured out as shown below. In the example below, the system has 4 memory slots and it has 2 x 512MB. If you have to expand upto 8GB of maximum RAM, you need to remove the 512MB from slot 1 and 2, and use 2GB RAM on all the 4 memory slots. This information will give sufficient ideas to plan for RAM expansion accordingly.

# dmidecode -t 17 | grep Size
Sample output:

        Size: 512 MB
        Size: 512 MB
        Size: No Module Installed
        Size: No Module Installed

References:

dmidecode can also be used to identify details about several other hardware related information. dmidecode command reads the systems DMI table for the hardware and BIOS information. DMI stands for Desktop Management interface and SMBIOS stands for System Management BIOS.

Distributed Management Task Force maintains the DMI and SMBIOS specification:

This article was written by Ramesh Natarajan. At the The Geek Stuff blog he shares his knowledge and experience on Linux and other Geeky stuff. He has more than 15 years of experience in IT industry and has performed very intensive work on Linux system administration, DBA, Hardware and Storage. nixCraft welcomes readers' tips / howtos.

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 5 comments… read them below or add one }

1 moko 07.24.08 at 11:20 am

Cool… I was googling the web yesterday for this info and couldn’t find it! and voila.. all written! thanks :-)

2 devidas 07.24.08 at 2:34 pm

i was planning to expand my ram memory.. had been thinking to buy new ram and thanks for the article it really helped in getting to know the stuff inside.

3 Guille 07.24.08 at 6:59 pm

Hello ev1;

great articule and great command, but in several of my server im receiving on the output ie:

[root@server1 ~]# dmidecode –type 17
–type: No such file or directory

[root@server1 ~]# dmidecode –type 11
–type: No such file or directory

neither with;

[root@server1 ~]# dmidecode processor
processor: No such file or directory

HOw can i fix it ?, i was googling but nothing
good.

Thanks!.

4 Krzysztof Wilczynski 08.18.08 at 10:45 pm

Dear Guille,

You should use either -t or –type, but never -type with single dash (that is indeed incorrect). You can see dmidecode’s help screen by executing it with –help as an argument (alternatively, you can read the manual page: man dmidecode). If you are unsure about what to do then simply execute dmidecode without any arguments at all.

Kindest regards,
Krzysztof

5 Jared 11.26.08 at 2:05 am

Very useful stuff – any way to differentiate between SDRAM, DDR, DDR2, DDR3?

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Tagged as: , , , , , , , , , , , , , , , , , , ,

Previous post: Download Of The Day: OpenSSH 5.1

Next post: Verify DNS Cache Poisoning Bug Using Windows XP / Vista / 2003 / 2008 System Command Prompt