Linux built-in command free output detailed background: recently assisted QA to test the self-developed server module, pressure test to observe the process memory usage, use the linux built-in command free, have to say, for new Linux users, the output of this command may be confusing. In order to find out its output meaning, I checked some materials and recorded them as notes, hoping to help beginners who are equally confused. Instance: enter free-m // Note:-m in the command line of the machine running the server process to specify that the output data is displayed in megabytes. The output result is as follows: total used free shared buffers cached Mem: 15360 13465 1894 9962 0 45 3456-/+ buffers/cache: 11903 Swap: 0 0 0 when I see this output, it is quite blank, in general, there are three main questions: doubt 1. for machines with 15 GB memory, why is free memory only 1894 MB? Where did the rest go? Question 2: What does buffers and cached mean? Question 3:-/+ buffers/cache? How are the two columns of data output from this row calculated? What is a numerical value? Overwhelmed? At this time, google should be ready! After a long time, I stood on the shoulders of many Titans and finally understood it. Survey data: 1. first of all, you must have a certain understanding of linux storage management. The following link can help (it is easier to understand if you have a basic operating system) about linux kernel's use of machine memory: http://serverfault.com/questions/9442/why-does-red-hat-linux-report-less-free-memory-on-the-system-than-is-actually-av probably means that linux needs to squeeze machine resources to the maximum extent, so even if the machine is just started, its free memory is much less than expected, the reason is that the operating system reserves most of the memory in advance, and the memory allocation will be scheduled or re-allocated by the OS in these reserved memory. So far, 1st questions have been answered. the concept of buffers and cached: http://stackoverflow.com/questions/6 345020/linux-memory-buffer-vs-cache many terms cannot be translated, so it is recommended that you directly read the original post's English explanation. At this point, 2nd questions have an answer 3. built-in command free output-/+ buffers/cache line meaning the most important section of the http://thoughtsbyclayg.blogspot.com/2008/09/display-free-memory-on-linux-ubuntu.html Abstract: So really the buffers wocould be allocated to a running process if it asked for them anyway, and the memory being used to cache copies of recently used files wocould be released immediately if It makes sense to allocate the RAM elsewhere. so all that memory is 'available '. using these definitions: When thinking about' how much memory is really being used '-I want to calculate: 'used'-('buffers' + 'cached ') when thinking about'how much memory is really free '-I want to calculate: 'free' + ('buffers' + 'cached') With this in mind, the meaning of the second row header form the output Of the Linux command "free" (-/+ buffers/cache :) makes more sense... so far, the 3rd questions have solved the result analysis: Now the initial problem is returned. To facilitate the analysis, the output of free-m on my test machine is given again: total used free shared buffers cached Mem: 15360 13465 1894 0 45 9962-/+ buffers/cache: 3456 11903 Swap: 0 0 0 from the output data combined with the previous survey results, we can get the following information: 1. the physical memory of this machine is 15360 MB, that is, 15 GB, which meets the actual configuration of the machine. currently, the actually used memory is (13465-45-9962) M = 3458 M, which is consistent with the data 3456 in the 'used' column output by the-/+ buffers/cache row, it may be because the output statistics have been rounded up. (I guess the error is not confirmed yet) 3. currently, the actual available memory is (1894 + 45 + 9962) M = 11901 M, which is consistent with the data 11903 In the 'free' column output by the-/+ buffers/cache row (with a slight error, we can clearly realize that the 'free' column in the 1st rows output by the free command is not the current amount of memory available by the system, and the actual amount of information is output in 2nd rows, and how the two columns of the 2nd rows are calculated? It must be clear now. By analogy: when using the top Command, is it still quite confusing about a bunch of output items? By analyzing the output results of the free command, the meanings of the following two rows of top output are very clear. Mem: 15728640 k total, 15648128 k used, 80512 k free, 48824 k buffers Swap: 0 k total, 0 k used, 0 k free, 12038836 k cached