I have a pretty busy GNU/Linux server that I think needs more RAM. I know that the free command doesn't show the amount of RAM that is used.

So I was stumbling upon Commited_As in /proc/meminfo. It currently shows 57972 kB which isn't much. Is this the amount of RAM that the processes use "right now" or is this an estimate of how many additional RAM it would take to never run out of memory with this load?

  • 1
    "I know that the free command doesn't show the amount of RAM that is used." Sure it does. You just need to be careful to understand how cached RAM works. – ceejayoz Sep 24 '12 at 15:57

Yeah, Committed_AS is the field to look for. What Robert said, it is a 99.99% guarantee that the system will not OOM if all the memory requests are granted and allocated by that kernel at that particular instant.

From kernel source.

Committed_AS: The amount of memory presently allocated on the system.
714 The committed memory is a sum of all of the memory which
715 has been allocated by processes, even if it has not been
716 "used" by them as of yet. A process which malloc()'s 1G
717 of memory, but only touches 300M of it will only show up
718 as using 300M of memory even if it has the address space
719 allocated for the entire 1G. This 1G is memory which has
720 been "committed" to by the VM and can be used at any time
721 by the allocating application. With strict overcommit
722 enabled on the system (mode 2 in 'vm.overcommit_memory'),
723 allocations which would exceed the CommitLimit (detailed
724 above) will not be permitted. This is useful if one needs
725 to guarantee that processes will not fail due to lack of
726 memory once that memory has been successfully allocated.

It is declared as a struct in source and is used in the function _vm_enough_memory() to see whether a process can grow in memory or not.

To cut short, it is a pretty good parameter to watch for memory issues.

  • So say my server reports Commited_As = 57972 kB and assume my workload is always about the same, I'd have enough memory when the server has 1 gig memory? – Daniel Sep 24 '12 at 19:59
  • I don't understand your question really. Can you post the /proc/meminfo file and I will see. – Soham Chakraborty Sep 25 '12 at 0:51
  • Here it is: pastie.org/4796044 – Daniel Sep 25 '12 at 7:12
  • 1
    Yeah, most of your memory is cached. And Committed_AS is around 40 MB which is pretty okay as it is way less than your (Memfree+swapfree) total, If the working set remains same, I don't see any reason of problem in your set up. – Soham Chakraborty Sep 26 '12 at 3:13

Committed_As is an estimate of how much RAM you would need to make a 99.99% guarantee that there never is OOM.

That said I'm not sure how accurate this is or if I'd bet the farm on it. On my current server it's almost twice my active + inactive memory usage while on another server i have it shows 61mb while the server has about a gig in active. Kinda raises my suspicions about this number...


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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