This article specifically written for showing on how to check the physical memory of an operating system which in this context, it is the physical memory of a Linux operating system. Using specific command, the amount of size possessed which is describing the total size of physical memory can be revealed. To be able to show the memory size of the physical memory attached in the server, host or workstation, it can be achieved by executing command available in the operating system :
1. cat /proc/meminfo
It is actually a command to display the content of the file named meminfo located in /proc.
user@hostname:~$ cat /proc/meminfo MemTotal: 8085320 kB MemFree: 312608 kB MemAvailable: 668600 kB Buffers: 61944 kB Cached: 699168 kB SwapCached: 29040 kB Active: 3932780 kB Inactive: 1185576 kB Active(anon): 3678616 kB Inactive(anon): 977236 kB Active(file): 254164 kB Inactive(file): 208340 kB Unevictable: 252 kB Mlocked: 252 kB SwapTotal: 8298492 kB SwapFree: 4392368 kB Dirty: 1400 kB Writeback: 0 kB AnonPages: 4348796 kB Mapped: 2523516 kB Shmem: 298608 kB Slab: 216624 kB SReclaimable: 124844 kB SUnreclaim: 91780 kB KernelStack: 17328 kB PageTables: 92588 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 12341152 kB Committed_AS: 17194540 kB VmallocTotal: 34359738367 kB VmallocUsed: 0 kB VmallocChunk: 0 kB HardwareCorrupted: 0 kB AnonHugePages: 425984 kB CmaTotal: 0 kB CmaFree: 0 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB DirectMap4k: 873216 kB DirectMap2M: 7426048 kB DirectMap1G: 1048576 kB user@hostname:~$
As shown in the above output, the total physical memory is stated in the MemTotal display as shown below :
MemTotal: 8085320 kB
It is 8085320 kiloByte. It is actually converted as 7,7 GB and it can be considered if it is rounded to the top as 8 GB.
2. free -m
It is a command which can be utilized to display memory size as shown below :
user@hostname:~$ free -m total used free shared buff/cache available Mem: 7895 6672 266 287 957 620 Swap: 8103 3810 4293 user@hostname:~$
The memory size, it is shown in the total Mem : 7985.
It is a command which is useful for printing or displaying Linux processes. As shown in the following output :
top - 22:53:05 up 5 days, 1:13, 38 users, load average: 1,02, 1,18, 1,04 Tasks: 428 total, 1 running, 425 sleeping, 0 stopped, 2 zombie %Cpu(s): 25,6 us, 9,9 sy, 0,1 ni, 57,6 id, 6,9 wa, 0,0 hi, 0,0 si, 0,0 st KiB Mem : 8085320 total, 240348 free, 6822896 used, 1022076 buff/cache KiB Swap: 8298492 total, 4380812 free, 3917680 used. 645204 avail Mem
It can be seen that the KiB Mem is 8085320. There is no different between KB and KiB calcuation. It is just the notation which came up at 2000 from IEC to avoid confusion. The notation of KiB stands for KibiByte. The bi in the KibiByte is referring to the term of binary which is symbolized as in 2. It is the division of 1024 derived from the power of 2 for the size or the number can be converted into GiB.