View memory and swap swap partition size and usage
man free
NAME free - Display amount of free and used memory in the system SYNOPSIS free [-b | -k | -m] [-o] [-s delay ] [-t] [-l] [-V] DESCRIPTION free displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel. The shared mem- ory column should be ignored; it is obsolete. Options The -b switch displays the amount of memory in bytes; the -k switch (set by default) displays it in kilobytes; the -m switch displays it in megabytes. The -t switch displays a line containing the totals. The -o switch disables the display of a "buffer adjusted" line. If the -o option is not specified, free subtracts buffer memory from the used memory and adds it to the free memory reported. The -s switch activates continuous polling delay seconds apart. You may actually specify any floating point number for delay, usleep(3) is used for microsecond resolution delay times. The -l switch shows detailed low and high memory statistics. The -V switch displays version information. FILES /proc/meminfo-- memory information
free -m -s 6 ### outputs once every 6s
[root@VM_0_3_centos ~]# free -m total used free shared buffers cached Mem: 3830 3723 107 0 240 1604 -/+ buffers/cache: 1878 1952 Swap: 0 0 0
Calculation
191272k total amount of physical memory
total physical memory used 173656k used
17616k free amount of memory free
Free userd + = Total
22052k buffers as the amount of memory the kernel buffer
amount 123988k cached buffer swap.
- / + buffters / cache-userd
swap swap partition information