Take the 2-minute tour ×

I am trying to figure out the amount of cache and buffers that is available and be counted as free memory(that is listed in free and /proc/meminfo). If I drop_caches I get some free but how does it do? Where can I find its source code?

share|improve this question
add comment

1 Answer

Are you trying to get these values using some code ? Regardless of that you could get all memory information from "/proc/meminfo".

On my machine, I could see:

MemTotal:        2051856 kB
MemFree:          522948 kB
Buffers:           74036 kB
Cached:           760480 kB

If you have to get it through some program then you can parse this file easily. (Provided that you have access to proc filesystem)

share|improve this answer
well, that is no the question. the question is how much of cache is available as part of free. remember, linux doesnt release all of the caches only part of it so I need the formula. FYI : It is not memfree + buffers + cahced. –  purpletech Dec 24 '12 at 17:49
add comment

Your Answer


