Linux memory usage

Source: Internet
Author: User
Linux memory usage details command: free-m (-m means M bytes to display the content) totalusedfreesharedbufferscachedMem: 10027692320... information & nbsp; | & nbsp; Linux memory usage details command: free-m (-m means M bytes to display content) total used free shared buffers cachedMem: 1002 769 232 0 62 421-/+ buffers/cache: 286 715 Swap: 1153 0 1153 www.2cto.com part 1 Mem row: total memory: 1002 Mused memory used: 769 Mfree idle memory: 232 Mshared memory is no longer used currently, always 0 buffers Buffer cache memory: 62 Mcached Page cache memory: 421 M relationship: tota L (1002 M) = used (769 M) + free (232 M) second part (-/+ buffers/cache) :(-buffers/cache) used memory count: 286 M (refers to used-buffers-cached in the first part of the Mem row) (+ buffers/cache) free memory: 715 M (refers to the free + buffers + cached in the first part of the Mem row) can be seen-buffers/cache reflects the memory actually eaten by the program, the + buffers/cache reflects the total number of memory that can be used. The third part of www.2cto.com refers to swap partitions. I think you are still dizzy after reading the above. why is used and free so strange in the results of the first part (Mem) and the second part (-/+ buffers/cache. in fact, we can explain it in two ways. it is the Mem parameter for the operating system. buffers/cached are both used, so it is considered that free is only 232. for applications (-/+ buffers/cach ). buffers/cached is equivalent to available, because buffer/cached is used to improve the performance of program execution. when the program uses memory, buffer/cached will be quickly used. So let's take a look at the application. The free and used of (-/+ buffers/cache) are the main ones. so let's just look at this. in addition, I would like to tell you some common sense. in order to improve disk and memory access efficiency, Linux has made a lot of elaborate designs, in addition to caching dentry (for VFS, accelerating file path name conversion to inode ), two major Cache methods are also adopted: Buffer Cache and Page Cache. The former is used to read and write disk blocks, and the latter is used to read and write inode files. These caches can effectively shorten the time for I/O system calls (such as read, write, getdents. Remember that the memory is used, not for reference. unlike windows, no matter how much physical memory you have, you need to read it from the hard disk swap file. this is why windows often prompts insufficient virtual space. think about it. it's boring. when there is still a large amount of memory, you can use some hard disk space to act as the memory. how is the hard disk faster than the memory. therefore, in linux, as long as the swap space of swap is not used, we don't have to worry about having too little memory. if many swap instances are used, you may need to add physical memory. this is also the standard for linux to check whether the memory is sufficient. in addition, you can use the top command to dynamically view the list of processes with the most memory, CPU, and resources.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.