to view the memory usage under the Linux server, you can use the command free -m. Note that this command is only valid under Linux. There is no such command in FreeBSD. The command is as follows:
used: Number of used memory
free: Number of free memory
shared: Total memory shared by multiple processes
-buffers/cache: (used) memory, ie used-buffers-cached
+buffers/cache:( The amount of memory available, ie free+buffers+cached
, concludes that:
The available memory is calculated as:
Available memory=free+buffers+cached, That is 215MB+11MB+57MB=253MB
Linux memory is used, not to look at it. When I talked to a friend about Linux usage, he asked me why Linux uses so much memory. The 1GB of memory on his machine is only 232MB free, and Windows
XP uses less than 200MB. This is actually confusing by the appearance of Linux's free command, Linux memory usage is very particular. As an example, the following free command shows the current memory usage, -m means to display the content with M bytes, let's take a look.
The following parameters are included in the first part of the Mem line.
total: Total memory, ie 378MB
used: The number of used memory, ie 769MB
free: the number of free memory, ie 232MB
Shared: currently obsolete, always 0
buffers Buffer: cache memory, ie 62MB
cached Page: cache memory, ie 421MB
where, total memory The relationship with the number of used and free memory is:
total(1002M)=used(769M)+free(232M)
In the second part (-/+buffers/The parameters in the cache are as follows.
(-buffers/cache): The number of used memory, which is 286MB (refers to the used-buffers-cached in the first part of the Mem line).
(+buffers/cache): Free memory, ie 715MB (refers to free+buffers+cached in the first part of the Mem line).
Visible -buffers/cache reflects the memory that is actually being used by the program, and +buffers/cache reflects the total amount of memory that can be used.
The third part refers to the swap partition. Everyone should understand that it will not be discussed here.
It is possible that everyone has read the above explanation or not quite understand. For example: the first part (Mem) is related to the result of the second part (-/+buffers/cache). Why is used and free so strange? In fact, we can analyze from two aspects. For operating system
, these two are Mem parameters, buffers/cached are used, so it thinks free is only 232MB; for applications, +buffers/cached is equivalent to available memory, because Buffer/cached can improve the performance of program execution. When the program uses memory, buffer/cached will be used very quickly. So from the application point of view, should be based on (-/+buffers/cache) free and used, that is, we mainly look at the free and used related to it. In addition to tell you some common sense, in order to improve the access efficiency of disk and memory, a lot of careful design for Linux, in addition to the dentry cache (for VFS, speed up file path name to inode conversion), also took two The main Cache methods: Buffer Cache and Page Cache. The former is used for reading and writing of disk blocks, and the latter is used for reading and writing of file inodes. These Caches can effectively reduce the time of I/O system calls (such as read, write, getdents).
In Linux, memory is used, not to look at it. In Windows, no matter how much real physical memory you have, it will use the hard disk to exchange files for reading, even if there is a large part of the memory. This is why Windows often prompts for insufficient virtual space. I can imagine how the hard disk will be faster than the memory, so when we observe the memory usage of Linux, as long as we do not find swap space with swap, we don't have to worry about our own memory. If you often see a lot of swap, then you should consider adding physical memory. This is also the standard for seeing if the memory is sufficient on a Linux server.
ReiserFS file system is a very good file system, especially for large files or a large number of sma
In Windows, Sogou Pinyin input method has a large number of users because of its large vocabulary an
Linux support for NICs is better than other hardware. XteamLinux 4.0
Problem Description Solution Reasons for analysis, maybe because my platform migr
Linux system security hardening tutorial
Linux Tutorial: Modifying the Usage of the File Permission Command chmod
Linux server is running for 210 days or so
Tips for flexible use of expect scripts under Linux
Clearing the record of operation information under Linux system
Eth0: ERROR while getting interface flags: No such device
Virtual Memory Management for Linux System Performance Test
In-depth analysis of soft interrupts in the Linux kernel
How to modify the network card after Linux virtual machine migration
What should I do if the PDF does not display thumbnails in the folder under Win8.1?
How to install dual system win10?
Tianya Mingyue knife Qinchuan Lingxi point distribution specific location
Experts in-depth analysis of Win7 device driver management
Win10 right mouse button response time solution
Large capacity hard disk typical partitioning scheme
Win7 error report pop-up prompt window how to cancel
Pure installation of Windows 10 official tools experience
WIN2003 IIS 500 internal server error (typical ACCESS database can not be accessed) Resolve