[root@CENTOS7 ~]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
[root@CENTOS7 ~]#
You can check the memory status in the system with the free
command.
The output result is as follows.
output result of free command
[root@CENTOS7 ~]# free
total used free shared buff/cache available
Mem: 1014820 184368 684116 6928 146336 683684
Swap: 1679356 0 1679356
[root@CENTOS7 ~]#
Each item is as follows.
item | Contents |
---|---|
total | Total memory amount |
used | Memory usage (memory actually used by the process) |
free | Unallocated memory amount that is not used at all |
shared | Amount of memory used in shared memory |
buff/cache | Amount of memory used for file buffer + cache memory |
available | Amount of memory available to the process |
Notes
Short option | Long option | Contents |
---|---|---|
-b | --bytes | Display memory amount in bytes |
-k | --kilo | Display memory amount in kilobytes |
-m | --mega | Display memory amount in megabytes |
-g | --giga | Display the amount of memory in gigabytes |
--tera | Display the amount of memory in terabytes | |
--peta | Display memory amount in petabytes | |
-h | --human | Displayed in easy-to-read units |
-w | --wide | Display in wide mode |
-c times | --count times | Specify the number of times to output (default is to output once and finish) |
-l | --lohi | Show low memory and high memory status Low memory: Area used by the Linux kernel High memory: Memory area used by the process |
-s interval | --seconds interval | Output interval is "ss".Specified by "tt seconds" (default is output once and finished) |
--si | Calculated by dividing by 1000 instead of 1024 when converting units | |
-t | --total | Show row showing total physical and swap memory |
FREE(1) User Commands FREE(1)
NAME
free - Display amount of free and used memory in the system
SYNOPSIS
free [options]
DESCRIPTION
free displays the total amount of free and used physical and swap mem‐
ory in the system, as well as the buffers and caches used by the ker‐
nel. The information is gathered by parsing /proc/meminfo. The dis‐
played columns are:
total Total installed memory (MemTotal and SwapTotal in /proc/meminfo)
used Used memory (calculated as total - free - buffers - cache)
free Unused memory (MemFree and SwapFree in /proc/meminfo)
shared Memory used (mostly) by tmpfs (Shmem in /proc/meminfo, available
on kernels 2.6.32, displayed as zero if not available)
buffers
Memory used by kernel buffers (Buffers in /proc/meminfo)
cache Memory used by the page cache and slabs (Cached and SReclaimable
in /proc/meminfo)
buff/cache
Sum of buffers and cache
available
Estimation of how much memory is available for starting new
applications, without swapping. Unlike the data provided by the
cache or free fields, this field takes into account page cache
and also that not all reclaimable memory slabs will be reclaimed
due to items being in use (MemAvailable in /proc/meminfo, avail‐
able on kernels 3.14, emulated on kernels 2.6.27+, otherwise the
same as free)
OPTIONS
-b, --bytes
Display the amount of memory in bytes.
-k, --kilo
Display the amount of memory in kilobytes. This is the default.
-m, --mega
Display the amount of memory in megabytes.
-g, --giga
Display the amount of memory in gigabytes.
--tera Display the amount of memory in terabytes.
--peta Display the amount of memory in petabytes.
-h, --human
Show all output fields automatically scaled to shortest three
digit unit and display the units of print out. Following units
are used.
B = bytes
K = kilos
M = megas
G = gigas
T = teras
P = petas
If unit is missing, and you have exabyte of RAM or swap, the
number is in terabytes and columns might not be aligned with
header.
-w, --wide
Switch to the wide mode. The wide mode produces lines longer
than 80 characters. In this mode buffers and cache are reported
in two separate columns.
-c, --count count
Display the result count times. Requires the -s option.
-l, --lohi
Show detailed low and high memory statistics.
-s, --seconds seconds
Continuously display the result delay seconds apart. You may
actually specify any floating point number for delay, usleep(3)
is used for microsecond resolution delay times.
--si Use power of 1000 not 1024.
-t, --total
Display a line showing the column totals.
--help Print help.
-V, --version
Display version information.
FILES
/proc/meminfo
memory information
SEE ALSO
ps(1), slabtop(1), top(1), vmstat(8).
AUTHORS
Written by Brian Edmonds.
REPORTING BUGS
Please send bug reports to [email protected]?
procps-ng July 2014 FREE(1)
FREE(1) User Commands FREE(1)
NAME
free -Show the amount of free and used memory on your system
SYNOPSIS
free [options]
DESCRIPTION
free is the total amount of free and used physical and swap memory in the system,
And displays the buffers and caches used by the kernel.
The information is "/proc/It is collected by analyzing "meminfo".
The columns displayed are:
total Total installed memory ("/proc/"MemTotal" and "SwapTotal" in meminfo)
used used memory ("total"- free - buffers -Calculated as "cache")
free unused memory ("/proc/"Mem Free" and "Swap Free" in meminfo)
shared (mainly) memory used by tmpfs (""/proc/"Shmem" in "meminfo", kernel 2.6.Available at 32, displayed as zero if not available)
buffers
Memory used by the kernel buffer ("/proc/"Buffers" in "meminfo")
cache Memory used by page cache and slab ("/proc/"Cached" and "SReclaimable" in meminfo)
buff/cache
Buffer and cache sum
available
Estimate the amount of memory available to start a new application without swapping.
Unlike the data provided by the cache or free fields
This field takes into account the page cache and for items in use
Not all recoverable memory slabs will be recovered
(「/proc/"MemAvailable" of "meminfo", kernel 3.Available at 14,
Emulated kernel 2.6.After 27, other than that, it is the same as free)
OPTIONS
-b, --bytes
Displays the amount of memory in bytes.
-k, --kilo
Displays the amount of memory in kilobytes. This is the default.
-m, --mega
Displays the amount of memory in megabytes.
-g, --giga
Displays the amount of memory in gigabytes.
--tera Displays the amount of memory in terabytes.
--peta Displays the amount of memory in petabytes.
-h, --human
Shows all output fields that are automatically scaled to a minimum of 3 digits
Displays the print unit. The following units are used.
B = bytes
K = kilos
M = megas
G = gigas
T = teras
P = petas
If you don't have a unit and you have exabytes of RAM or swap
The numbers are in terabytes and the columns may not be aligned with the headers.
-w, --wide
Switch to wide mode. Wide mode produces lines longer than 80 characters.
In this mode, the buffer and cache are reported in two separate columns.
-c, --count count
Displays the number of counts of the result.-Requires the s option.
-l, --lohi
View detailed low and high memory statistics.
-s, --seconds seconds
Continuously displays the result delay in seconds.
You can actually specify any floating point number for the delay.
usleep (3) is used for microsecond resolution delay times.
--si Use power of 1000 not 1024.
Use a power of 1000 instead of 1024.
-t, --total
Shows a row showing the total of the columns.
--help Print help.
Print help.
-V, --version
Display version information.
FILES
/proc/meminfo
memory information
SEE ALSO
ps(1), slabtop(1), top(1), vmstat(8).
AUTHORS
Written by Brian Edmonds.
REPORTING BUGS
Please send bug reports to ⟨[email protected]⟩
procps-ng July 2014 FREE(1)
that's all
Recommended Posts