A day command (1) free command

free command displays the current number of used memory and the system is not used, the display memory buffer may also be used by the kernel.

(1) Usage:

Usage: free [option argument]

(2) function:

Function: free command displays the system memory usage and idle, including physical memory, swap memory (the swap) and the kernel buffer memory. Shared memory is ignored.

(3) option parameter:

1) -b Displays in Byte memory usage

2) -k in KB display memory usage

3) -m in MB display memory usage

4) -g in GB display memory usage

5) -s performed once every 3 seconds free operation

(4) Example:

free display memory usage

[sunjimeng @ localhost ~] $ free // Displays in kn 
              Total Used Free Shared BUFF / Cache Available 
Mem: 2,013,872 641 564 864 800 10132 507 508 1164056 
Swap: 2,097,148 2,097,148 0 
[sunjimeng @ localhost ~] $ // Free -m in MB displays 
              Total Used Free Shared BUFF / Cache Available 
Mem: 1966. 9 495 1136 626 844 
Swap: 2047 0 2047 
[sunjimeng @ localhost ~] -g $ // Free GB for displaying  
              total used free shared buff / cache available
Mem: 1 0 0 0 0 1
Swap:             1           0           1

Mem line interpreter first portion:

total: The total number of memory;

used: the number of memory already in use;

free: the amount of memory free;

Buffers / cached: disk cache size;

关系:total=used+free+Buffers/cached

Swap refers to the second part of the swap partition, which is what we usually refer to virtual memory

2) free -t display memory usage in general form

[sunjimeng@localhost ~]$ free -t
              total        used        free      shared  buff/cache   available
Mem:        2013872      640344      865772       10132      507756     1165108
Swap:       2097148           0     2097148
Total:      4111020      640344     2962920

3) free -s 3 free operation is performed once every three seconds

[sunjimeng@localhost ~]$ free -s 3
              total        used        free      shared  buff/cache   available
Mem:        2013872      642136      863972       10132      507764     1163300
Swap:       2097148           0     2097148

              total        used        free      shared  buff/cache   available
Mem:        2013872      642148      863960       10132      507764     1163288
Swap:       2097148           0     2097148
......

(5) Other:

buffers and cache are cached, the difference between the two:

In order to improve the efficiency of disk access, Linux made some careful design, in addition to the dentry cache (for VFS, accelerated file pathname to inode conversion), also adopted two main ways Cache: Buffer Cache and Page Cache. The former disk blocks for reading and writing, which read and write file for the inode. These Cache effectively shortening the time I / O system calls (such as read, write, getdents) of.

Simply put, page cache to cache file data, buffer cache used to cache disk data. In the case of a file system, the file operation, then the data cached to the page cache, disk read and write using tools such as between dd If, then the data cached to buffer cache.

So we look at Linux, as long as no swap space swap, you do not have to worry about their memory too, if often swap with a lot, you might consider adding physical memory, and this is Linux look at the adequacy of standard memory.

 

Guess you like

Origin www.cnblogs.com/J-yup/p/11728462.html