5 Ways to find Memory size in Linux
[1] Using “free” Command
[stextbox id=”Default” mode=”css” bwidth=”7″ color=”FFFFFF” ccolor=”000000″ bcolor=”1A52EA” bgcolor=”000000″ bgcolorto=”000000″ image=”null”]
[root@quickfixlinux ~]# free -m | ||||||
total | used | free | shared | buff/cache | available | |
Mem: | 128636 | 34088 | 475 | 132 | 94072 | 93798 |
Swap: | 15359 | 31 | 15328 | |||
[root@quickfixlinux ~]# free -g | ||||||
total | used | free | shared | buff/cache | available | |
Mem: | 125 | 33 | 0 | 0 | 91 | 91 |
Swap: | 14 | 0 | 14 |
[/stextbox]
[2] Using the lshw command:
[stextbox id=”Default” mode=”css” bwidth=”7″ color=”FFFFFF” ccolor=”000000″ bcolor=”1A52EA” bgcolor=”000000″ bgcolorto=”000000″ image=”null”]
[root@quickfixlinux ~]# lshw -short |grep DDR4
/0/a/0 | memory | 16GiB DIMM DDR4 Synchronous Registered (Buffered) 2400 MHz (0.4 ns) |
/0/a/1 | memory | DIMM DDR4 Synchronous [empty] |
/0/a/2 | memory | DIMM DDR4 Synchronous [empty] |
/0/a/3 | memory | 16GiB DIMM DDR4 Synchronous Registered (Buffered) 2400 MHz (0.4 ns) |
/0/a/4 | memory | DIMM DDR4 Synchronous [empty] |
/0/a/5 | memory | DIMM DDR4 Synchronous [empty] |
/0/a/6 | memory | DIMM DDR4 Synchronous [empty] |
/0/a/7 | memory | DIMM DDR4 Synchronous [empty] |
/0/a/8 | memory | 16GiB DIMM DDR4 Synchronous Registered (Buffered) 2400 MHz (0.4 ns) |
/0/a/9 | memory | DIMM DDR4 Synchronous [empty] |
/0/a/a | memory | DIMM DDR4 Synchronous [empty] |
/0/a/b | memory | 16GiB DIMM DDR4 Synchronous Registered (Buffered) 2400 MHz (0.4 ns) |
/0/a/c | memory | 16GiB DIMM DDR4 Synchronous Registered (Buffered) 2400 MHz (0.4 ns) |
/0/a/d | memory | DIMM DDR4 Synchronous [empty] |
/0/a/e | memory | DIMM DDR4 Synchronous [empty] |
/0/a/f | memory | 16GiB DIMM DDR4 Synchronous Registered (Buffered) 2400 MHz (0.4 ns) |
/0/a/10 | memory | DIMM DDR4 Synchronous [empty] |
/0/a/11 | memory | DIMM DDR4 Synchronous [empty] |
/0/a/12 | memory | DIMM DDR4 Synchronous [empty] |
/0/a/13 | memory | DIMM DDR4 Synchronous [empty] |
/0/a/14 | memory | 16GiB DIMM DDR4 Synchronous Registered (Buffered) 2400 MHz (0.4 ns) |
/0/a/15 | memory | DIMM DDR4 Synchronous [empty] |
/0/a/16 | memory | DIMM DDR4 Synchronous [empty] |
/0/a/17 | memory | 16GiB DIMM DDR4 Synchronous Registered (Buffered) 2400 MHz (0.4 ns) |
[/stextbox]
[3] Using “dmidecode” command:
[stextbox id=”Default” mode=”css” bwidth=”7″ color=”FFFFFF” ccolor=”000000″ bcolor=”1A52EA” bgcolor=”000000″ bgcolorto=”000000″ image=”null”]
[root@quickfixlinux ~]# dmidecode -t
dmidecode: option requires an argument — ‘t’ Type number or keyword expected Valid type keywords are:
[root@quickfixlinux ~]# dmidecode memory # dmidecode 3.2 Getting SMBIOS data from sysfs. SMBIOS 2.8 present. 247 structures occupying 9707 bytes. Table at 0x788CB000.
|
[/stextbox]
[4] Using /proc/meminfo Command:
[stextbox id=”Default” mode=”css” bwidth=”7″ color=”FFFFFF” ccolor=”000000″ bcolor=”1A52EA” bgcolor=”000000″ bgcolorto=”000000″ image=”null”]
[root@quickfixlinux ~]# cat /proc/meminfo |grep -i mem
MemTotal: 131724024 kB MemFree: 491128 kB MemAvailable: 96054460 kB |
[/stextbox]
[5] Using “top” command:
[stextbox id=”Default” mode=”css” bwidth=”7″ color=”FFFFFF” ccolor=”000000″ bcolor=”1A52EA” bgcolor=”000000″ bgcolorto=”000000″ image=”null”]
[root@quickfixlinux ~]# top
top – 16:49:02 up 17 days, 21:42, 3 users, load average: 0.05, 0.04, 0.05
Tasks: 637 total, 1 running, 635 sleeping, 1 stopped, 0 zombie %Cpu(s): 0.2 us, 0.0 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem : 13172402+total, 491388 free, 34901028 used, 96331608 buff/cache KiB Swap: 15728636 total, 15696116 free, 32520 used. 96054728 avail Mem |
[/stextbox]