1

I recently installed a copy of Ubuntu Server 14.04.2 LTS on a cluster. All appears to be working fine, but a large portion (around half) of our total available RAM is being used. I.e., when I run free I get the following output (the buffers/cache line being the relevant one):

          total       used       free     shared    buffers     cached
Mem:           251        215         36          0          2         70
-/+ buffers/cache:        141        110
Swap:           22          0         22

I checked the outputs of both ps and lsof to get the total memory usage per user, and nobody is using more than 1% of the RAM. I've read that Linux does not immediately free up memory used by exited processes, but is it feasible that it would continue using this much memory? If not, is there anything else that could be taking up all of this memory?

jaipel
  • 49
  • 5
  • 1
    That occurred to me, but cached memory is only about 1/3 of the used memory (looking at the first row). When looking at the second row, a little over half of the memory is still being used (even if you lump cached memory, buffers, and free memory together). – jaipel Jun 19 '15 at 14:40
  • I've never been a very lucky gambler. Your question should never have been downvoted regardless. In case you're not aware, there is no shame in accepting your own answer (tomorrow), when it is a good one (as yours is). – mikeserv Jun 20 '15 at 00:20

1 Answers1

3

I figured out that a large portion of the memory usage was, in fact, attributable to inactive memory used by exited processes. The most accurate way to determine how much memory is available post-January 2014 is to look at MemAvailable in /proc/meminfo. You can also see the amount of inactive memory is this file.

jaipel
  • 49
  • 1
    No, “inactive memory used by exited processes” is included in the “free” number. Typically it's kernel caches that account for memory that isn't included in the “free”, “buffers” or “cached” numbers and isn't mapped by any process either. – Gilles 'SO- stop being evil' Jun 20 '15 at 22:04
  • Hi Gilles- Do you have any articles to read that might clarify how this works? I'm not sure I'm understanding Linux's memory management correctly in a larger sense, and it might be good for me to research this more deeply outside of the Q/A format. – jaipel Dec 15 '15 at 14:35
  • http://www.linuxatemyram.com/ – Gilles 'SO- stop being evil' Dec 15 '15 at 16:23