1. Top command: It is a common performance analysis tool under Linux, which can show the resource occupancy of each process in real-time.
2. Free command:
free-m Viewing memory usage
free-s continuously monitor how much memory is in use
--------------------------------------------------------------------------------------------------------------- -------------------
For example:
Total used free shared buffers Cached
MEM:128 119 8 0 1 22
-/+ buffers/cache:95 32
swap:255 0 255
Line 1th MEM Data:
- Total Memory: 128
- Used number of memory used: 119
- Free Memory Number: 8
- GKFX is currently obsolete. No, always 0.
- Buffers Buffer Cache Memory Number: 1
- Cached Page Cache Memory: 22
Line 2nd-/+ Buffers/cache:
- -buffers/cache Memory: 95 (equals 1th row of used-buffers-cached)
- +buffers/cache Memory: 32 (equals 1th line of Free + buffers + cached)
The visible-buffers/cache reflects the memory that is actually eaten by the program, and +buffers/cache reflects the total amount of memory that can be appropriated.
The third line of data is swap partition swap, which is what we typically call virtual memory . (swap is frequently used to indicate that there is not enough physical memory.) WORKAROUND: 1.top See which processes consume more memory and kill them; 2.reboot server can effectively release swap)
In order to improve disk access efficiency, Linux has done some careful design, in addition to the Dentry cache (for VFS, speed up the file path name to Inode conversion), but also adopted two main cache mode: Buffer cache and Page cache. The former is for the disk block read and write, the latter for the file inode read and write. These caches effectively shorten the time for I/O system calls (such as read,write,getdents).
--------------------------------------------------------------------------------------------------------------- ------------------
1) Interval Display free
As a stateful inspection tool, the best way to count memory utilization is to use a delay interval.
If we want to count memory utilization every 3 seconds and are suitable for human readability, then you can use FREE-HS 3
2) display high and low memory statistics
Free-l
3) Show All Linux memory
Free-t
3. PS Command: Shows the memory usage of each process in real time
PS aux--sort-rss
Three major Linux command to view CPU and memory usage