6

I know this is a lame question, but I want to understand why CentOS consumes my Physical memory when certain process stopped. Suppose I have opened a file of 10GB then it consumes 10GB in ram and buffers when I finished the process and closes the file, then CentOS still holds my 10GB of ram.

When I run free command it gives me following details:

11.4 GB are used
in buffers: 6336
in cached: 49168

-/+ buffers/cache: 11.4GB used

when I try to free up my memory using following solutions:

How do you empty the buffers and cache on a Linux system?

How to clear memory cache in Linux

Setting /proc/sys/vm/drop_caches to clear cache

-/+ buffers/cache: still holds 11.4 GB.

closed as unclear what you're asking by Gilles, Anthon, John WH Smith, Braiam, jasonwryan Feb 18 '15 at 2:54

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    First, read Linux ate my ram!!. Then read Linux ate my ram!!. Then, if you still have questions, tell us what you mean by “I try to free up my memory”. If you mean that you want to empty the cache, read Linux ate my ram!! and don't stop until you understand it. If that's not what you're asking, why is it surprising that your system is consuming 11.4GB of memory? How much memory are your processes using? – Gilles Feb 17 '15 at 22:00
5

First of all you don't need to free up any buffers or cache yourself unless you have a specific requirement. Linux saves caches for improving the performance of memory access. Buffers are just temporary location and both cache and buffers will keep changing depending on the tasks which Linux is doing.

There is a link which describes the fields very nicely http://www.linuxnix.com/2013/05/find-ram-size-in-linuxunix.html

Updating the new link: https://www.linuxnix.com/find-ram-size-in-linuxunix/

Incase the link doesn't work in future here is little more expalantion. Below is the output of free -m

             total       used       free     shared    buffers     cached
Mem:          7753       2765       4987          0         24        570
-/+ buffers/cache:       2171       5582
Swap:         8191          0       8191

-/+ in the second line:

Total used RAM is (2765) - (24 + 570) = 2171 [ - in the second line]
Total Free RAM is (7753 - 2765) + (24 + 570 ) = 5582 [ + in the second line ]
  • Unfortunately the link did stop working, as you expected – Hot.PxL Sep 26 '18 at 18:20
  • But it does redirect to the new location. Updating the new link. – bluefoggy Jan 5 at 5:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.