Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

From the Linux procfs documentation:

      Active: Memory that has been used more recently and usually not reclaimed unless
              absolutely necessary.
    Inactive: Memory which has been less recently used. It is more eligible to be
              reclaimed for other purposes
Committed_AS: The amount of memory presently allocated on the system. The committed 
              memory is a sum of all of the memory which has been allocated by 
              processes, even if it has not been "used" by them as of yet. (...)

My question relates to the Commited_AS memory, and the part of it that is actually used/unused. My understanding is that Active memory is the part of committed memory that is actually used. However, I do not know what happens with Inactive memory; does it also include the committed but unused memory, apart from memory that has not been recently used?

share|improve this question

1 Answer 1

See man proc; to quote directly:

A process which allocates 1GB of memory (using malloc(3) or similar), but touches only 300MB of that memory will show up as using only 300MB of memory even if it has the address space allocated for the entire 1GB. This 1GB is memory which has been "committed" to by the VM and can be used at any time by the allocating application.

Committed_AS is referring to the total amount of memory requested on the system for dynamic memory allocation; this would mean that inactive memory (which is not in the heap) is not counted. This is where the power of Virtual Memory comes in; a process "thinks" it has all the memory that it requested, but in reality it only has what it needs.

This also ties directly into the overcommit_memory sysctl configuration setting that can be used to prevent "over commitment" of memory so that the server doesn't OOM itself if it ever needs all the "committed" memory at once.

share|improve this answer
    
But isn't inactive memory allocated dynamically at one point or the other? Shouldn't it be actually measured in the Committed as well? I'm trying to break down the committed memory, I'm trying to understand why it's showing less than what's actually used in my system... –  cryobct Jun 20 at 8:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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