Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: [OT]What is "buffers" and "cached" memory in Linux system box?

by sunshine_august (Scribe)
on Sep 20, 2008 at 03:33 UTC ( #712686=note: print w/ replies, xml ) Need Help??


in reply to Re: [OT]What is "buffers" and "cached" memory in Linux system box?
in thread [OT]What is "buffers" and "cached" memory in Linux system box?

I try to rearrange the expression to make it more clear:

A = B + C = G + H G = B - E - F H = C + E + F
It seems that:

Mem: 1034332 983572 50760 0 149028 530132
shows "buffers" and "cached" as part of "used" memory.

But -/+ buffers/cache: 304412 729920
shows "buffers" and "cached" as part of "free" memory

The -/+ buffers/cache line shows how much memory is used and free from the perspective of the applications.
--- from http://gentoo-wiki.com/FAQ_Linux_Memory_Management#The_difference_between_buffers_and_cache

And I do a test on my box, it shows that when the "free" memory is going to be exhausted, the kernel will take back all the "buffers" memory, but still left some "cached"memory. Following is the output by "free -m -s 1" when I increasingly created threads to consume the memory:

total used free shared buffers cac +hed Mem: 7973 68 7904 0 8 + 27 -/+ buffers/cache: 33 7939 Swap: 2047 0 2047 total used free shared buffers cac +hed Mem: 7973 106 7866 0 8 + 27 -/+ buffers/cache: 71 7902 Swap: 2047 0 2047
total used free shared buffers cac +hed Mem: 7973 112 7860 0 8 + 27 -/+ buffers/cache: 77 7896 Swap: 2047 0 2047 ... ... total used free shared buffers cac +hed Mem: 7973 7750 222 0 8 + 27 -/+ buffers/cache: 7714 258 Swap: 2047 0 2047 total used free shared buffers cac +hed Mem: 7973 7752 220 0 8 + 27 -/+ buffers/cache: 7716 256 Swap: 2047 0 2047 total used free shared buffers cac +hed Mem: 7973 7834 138 0 8 + 27 -/+ buffers/cache: 7798 174 Swap: 2047 0 2047 total used free shared buffers cac +hed Mem: 7973 7932 40 0 7 + 22 -/+ buffers/cache: 7903 69 Swap: 2047 0 2047 total used free shared buffers cac +hed Mem: 7973 7930 42 0 0 + 11 -/+ buffers/cache: 7917 55 Swap: 2047 2 2045 total used free shared buffers cac +hed Mem: 7973 7931 41 0 0 + 3 -/+ buffers/cache: 7927 45 Swap: 2047 131 1915 total used free shared buffers cac +hed Mem: 7973 7925 47 0 0 + 4 -/+ buffers/cache: 7920 52 Swap: 2047 144 1903 total used free shared buffers cac +hed Mem: 7973 7925 47 0 0 + 4 -/+ buffers/cache: 7920 53 Swap: 2047 144 1903 total used free shared buffers cac +hed Mem: 7973 7925 47 0 0 + 4 -/+ buffers/cache: 7920 53 Swap: 2047 144 1903


Comment on Re^2: [OT]What is "buffers" and "cached" memory in Linux system box?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://712686]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2014-07-23 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (130 votes), past polls