Simpler Navigation coming for Servers and Operating Systems
Coming soon: a much simpler Servers and Operating Systems section of the Community. We will combine many of the older boards, and you won't have to click through so many levels to get at the information you need. If you are looking for an older board and do not find it, check the consolidated boards, as the posts are still there.
Operating System - Tru64 Unix
Showing results for 
Search instead for 
Did you mean: 

the swap mode

Occasional Contributor

the swap mode

Hi all,
who can tell me the two swap mode:laze and

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.

-- :
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.