Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-20 01:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found