5 Ways to find Memory size in Linux

[1] Using “free” Command

[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

 

[2] Using the lshw command:

[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)

[3] Using “dmidecode” command:

 

[root@quickfixlinux ~]# dmidecode -t

dmidecode: option requires an argument — ‘t’

Type number or keyword expected

Valid type keywords are:

  • bios
  •   system
  •   baseboard
  •   chassis
  •   processor
  •   memory
  •   cache
  • connector
  • slot

[root@quickfixlinux ~]# dmidecode memory 

# dmidecode 3.2

Getting SMBIOS data from sysfs.

SMBIOS 2.8 present.

247 structures occupying 9707 bytes.

Table at 0x788CB000.

Handle 0x000C, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x000A
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 16384 MB
        Form Factor: DIMM
        Set: None
        Locator: PROC 1 DIMM 1
        Bank Locator: Not Specified
        Type: DDR4
        Type Detail: Synchronous Registered (Buffered)
        Speed: 2400 MT/s
        Manufacturer: HP
        Serial Number: Not Specified
        Asset Tag: Not Specified
        Part Number: 809081-081
        Rank: 2
        Configured Memory Speed: 2400 MT/s
        Minimum Voltage: 1.2 V
Maximum Voltage: 1.2 V
Configured Voltage: 1.2 V

[4] Using /proc/meminfo Command:

[root@quickfixlinux ~]# cat /proc/meminfo |grep -i mem

MemTotal:       131724024 kB

MemFree:          491128 kB

MemAvailable:   96054460 kB

 

[5] Using “top” command:

[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

Leave a Reply