Linux memory management

    In Linux, it is often found that there is very little free memory. It seems that all the memory is occupied by the system. It seems that the memory is not enough, but it is not. This is an excellent feature of Linux memory management, and in this respect it is different from Windows memory management. The main feature is that no matter how big the physical memory is, Linux makes full use of it, reads the hard disk data called by some programs into the memory, and uses the high-speed characteristics of memory read and write to improve the data access performance of the Linux system. However, Windows allocates memory for applications only when memory is needed, and cannot make full use of the large-capacity memory space. In other words, every time you add some physical memory, Linux will be able to take full advantage of the benefits of hardware investment, while Windows will only use it as a decoration, even if you add 8GB or more. This feature of Linux mainly uses free physical memory to divide a part of the space as cache and buffers to improve data access performance.
    The cache is a primary disk cache implemented by the Linux kernel. It is mainly used to reduce I/O operations to disk. Specifically, by caching the data in the disk into the physical memory, the access to the disk is changed to the access to the physical memory.
    The value of a disk cache is twofold: First, access to disk is much slower than accessing memory, so accessing data from memory is faster than accessing it from disk. Second, once the data is accessed, it is likely to be accessed again in the short term.
    To sum up, it is generally not necessary to pay too much attention to the memory usage of Linux. If the SWAP usage rate is high, the memory may be insufficient.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325303995&siteId=291194637