[X-Unix] syslogd problems

James Bucanek subscriber at gloaming.com
Wed Jun 9 12:26:28 PDT 2004


Kevin Stevens wrote on Wednesday, June 9, 2004:

>What I don't understand is why, if I load a largish program from this
>point, I get pageouts instead of simply deallocating some of that vast
>pool of inactive memory (it actually does that, I've watched it with some
>slow growth apps like pine sorting a large newsgroup).

Inactive memory can exist in several states.  Inactive+allocated means that the memory block is mapped into a process's memory space, but simply hasn't been accessed in awhile.  Thus the term "inactive" rather than "unused."  These blocks can not be simply discarded.  They belong to some app and contain data.  These are typically the first candidates for blocks that will be swapped out if new blocks are needed.

The kernal periodically sweeps the list of active blocks and marks those as inactive that haven't been touched in awhile.  It has an algorithm that tries to maintain an optimal balance between active and inactive blocks.

Inactive+unallocated are used as temporary cache.  These can contain previously loaded code, disk buffers, whatever.  The idea is that the kernel knows what's in these blocks and can instantly resurrect them if the need arises.  These blocks do not have to paged out to be reused.

What can be confusing is that most of the system status utility simply list the total amount of "inactive" memory, without regard to what kind or combination of "inactive" it is.  You'll often notice the number of inactive blocks jump up or down as a consequence of a process touching a bunch of memory, or after not touching it for awhile.

>Or why I need 3+
>GB of swap in the first place, or why after allocating all that "base"
>swap it needs to add another 74MB swap file.

Probably because it ran out of real RAM and some process asked for more.  This happens quite often. ;)

______________________________________________________
James Bucanek       <mailto:privatereply at gloaming.com>



More information about the X-Unix mailing list