1.free
Displays memory usage with the default unit of KB.
Free-m in MB; free-g in GB
Figure 1-1 Free Command screenshot
The second line, used this column is usually relatively high, because Linux think that memory is idle, as well as buffer and cache. When memory is tight, this part of memory is automatically recycled by the OS.
The third line, where free represents the traditional sense of idle memory, used+free= the second line of total.
2.top
A Windows-like resource Manager can be displayed dynamically, as shown in Figure 2-1.
Figure 2-1 Top Command
RES represents memory footprint.
The view is refreshed automatically, press "P" to rewind by CPU usage and press "M" to drain the memory.
Figure 2-2 A few lines at the beginning of the top command
The lines at the beginning of the top command are shown in Figure 2-2.
The three decimal places after the load average represent nearly 1 minutes, 5 minutes, and 15 minutes of CPU load. If the numerical >cpu kernel number, the load is heavier and needs attention.
CPU cores can be viewed through the cat/proc/cpuinfo command. Note that the CPUID number starts at 0. 3.ps 3.1 ps aux
PS AUX displays the primary information for all processes. See Figure 3-1.
Figure 3-1 PS Command main parameter explanation.
%mem, percent memory footprint.
rss, memory footprint, in KB. %MEM is calculated from this value.
Time, the total CPU times that the lock occupies since it was started, not the length of time that is represented by the (now moment-startup moment). 3.2 PS--format
Ps-a--format=pid,stime,etime,command
Displays the specified column information.
command indicates the start of commands.
ETime indicates how long the process started, such as 16-21:48:28 16 days 21 hours 48 minutes 28 seconds, 02:47:35 means 2 hours 47 minutes 35 seconds, 47:35 for 47 minutes 35 seconds.