[Technology] Linux eaten up my memory-CCIE R&S Dumps Free Download

CCNA 200-301

CCNA 200-301

CCNP Enterprise

CCNP Enterprise

CCNP Security

CCNP Security

CCIE Enterprise Lab

CCIE Enterprise Lab

CCIE Security Lab

CCIE Security Lab

CCNP Service Provider

CCNP Service Provider

CCNP Data Center

CCNP Data Center

CCNP Collaboration

CCNP Collaboration

CCIE DC Lab

CCIE DC Lab

ic_r
ic_l
[Technology] Linux eaten up my memory-CCIE R&S Dumps Free Download
images
Explorer under Windows to see the memory usage, if the usage rate of 80% or more, and then run the big program can feel the system is not smooth, because the use of swap partition in the memory shortage, frequently from the disk for Incoming out of the page will greatly affect the performance of the system. And when we use the free command to see Linux system memory usage, we find that memory usage is always high, even though the system is not running much software at this time. This is the difference between Windows and Linux in memory management. At first glance, the Linux system eats our memory (Linux ate my ram), but in fact it is also the memory management features.
Free command introduced
The following is the free command to see the results of our lab file server memory, the -m option indicates the use of MB as a unit:

The second line of output indicates system memory usage:
Mem: total = 3920MB,
used (used) = 1938MB,
free = 1982MB,
shared (shared memory) = 0MB,
buffers = 497MB,
cached = 1235MB
Note: The first four are better understood, buffer and cache can not find the right words to translate, the difference is that:
The buffer is used to store the data to be output to the disk, and the cache is read from the disk into the memory to be used in the future data. Their introduction is to provide IO performance.
The third line of output indicates the use of the swap partition:
Swap: total = 4095MB
used = 0MB
free = 4095MB
Due to the current system memory is more adequate, did not use the swap partition.
The above output is more difficult to understand the result may be the third line, why show this line to the user data? Memory usage minus system buffer / cached memory mean? System free memory plus buffer / cached memory also expressed what?
Memory classification
We divide the memory into three categories, from the user and operating system perspective on the use of different names:
something represents the "buffers / cached" memory in the free command. Since this memory is indeed used from the operating system point of view, this memory can be quickly recalled by the user program if it is to be used by the user. From the user's point of view this piece of memory should be classified as idle.
Back to the free command output results, the output of the third line should be able to understand, this line figures from the user point of view of system memory usage. Therefore, if you use top or free command to see how much system memory, in fact, you should be free memory plus buffer / cached memory, that is the actual system free memory.
Linux
Memory management has done a lot of careful design, in addition to caching dentry (for VFS, to accelerate the file path name to inode conversion), has also taken two main Cache ways: Buffer Cache and Page Cache, the purpose is to enhance the disk IO Performance. Reading data from a low-speed block device is temporarily stored in memory, and even though the data is no longer needed at the time, the next time the application accesses the data, it reads directly from memory, bypassing low speed Block device, thereby improving the overall performance of the system.
Linux will make full use of these free memory, the design idea is not enough memory to cache some data, so next time the program again access the data faster, and if the program to use memory and the system memory is not enough , Instead of using swap partitions, you can quickly reclaim some of the cache and leave them to the user program.
So, you can see that buffers / cached is really one hundred benefits, the real downside may give users a false impression - Linux memory consumption! In fact, Linux does not eat your memory, as long as you have not used the swap partition, your memory is running low, you should be fortunate, because Linux cache a large amount of data, and perhaps the next time you benefit!
Experimental proof
The following experiment to verify the above CCIE R & S Dumps Free Download conclusion:
We have read into a large file, compare the practice of reading twice:
First, generate a large 1G file

Seen from the above, the first time reading this 1G file takes about 18s, while the second time to read again, only took 0.3s, a full 60-fold increase!