cancel
Showing results for 
Search instead for 
Did you mean: 

the swap mode

naVigAtor
Occasional Contributor

the swap mode

Hi all,
who can tell me the two swap mode:laze and
eager.thanks!

1 REPLY
Hein van den Heuvel
Honored Contributor

Re: the swap mode

RTFM! Or Google! or Manpage or Online Doc.!

Did you simply google +lazy +eager +unix? You'll get plenty of explanations.

One place to read up on this on the system is under "man swapon"... if you know what to look for as it is called "deferred mode" and "immediate mode" there.
Also check sysconfig.

-- http://www.ptc.com/partners/hardware/2000i2/faq/dec_faq.htm#3a :
Tru64 Unix has two swap modes; the default is called "eager" mode and the alternate is called
"overcommit" or "lazy" swap mode. In eager swap mode, the operating system reserves swap
space for a process whenever it makes a request for memory. That way if it ever needs to be
swapped out, it has somewhere to store it's pages in the swap area(s). In "lazy" swap mode, swap
space is used by a process only when it needs to be paged to disk.

What are the advantages and disadvantages?
In "eager" swap mode, a process always has a place to go if it needs to be paged out. In "lazy"
mode, if a process needs to be paged out and there is no place in the swap area to go, the OS will
start killing off other idle processes to make room for the active process to go to the swap
partition(s). This can be dangerous and it is for this reason that it is generally not recommended
to run in "lazy" swap mode. This is especially true for multi-user servers where users' processes
could be killed off seemingly at random. However, for single user workstations, this can be more
of an acceptable risk. If you are getting a lot of "Swap space below 10% free" messages in the
console window and do not have any additional free disk space to add more swap, switching to
"lazy" mode can usually alleviate these messages. This is because in "eager" swap mode, the
virtual memory of the system is essentially equal to the amount of swap space configured (every
process reserves it's space). In "lazy" swap mode, virtual memory = physical RAM + swap space
(swap isn't used until it's needed). "Lazy" swap mode also seems to have a slight performance
advantage because the OS doesn't have to reserve swap space for a process whenever it asks for
more memory.