Showing results for 
Search instead for 
Did you mean: 

swapper and vhand

Go to solution
Ganesh Balraman
Regular Advisor

swapper and vhand

Hi All!

What is the difference between vhand and swapper daemon? Both operarates swap.

How to identify which is being used and how to fodn out the usage of these daemons?

Regular Advisor

Re: swapper and vhand

The kernel always tries to maintain a threshold of free pages in order to keep the system running efficiently. As long as this threshold, referred to as lotsfree, is maintained, no paging occurs. When the number of free pages drops below this threshold, a daemon known as vhand selects pages that havenâ t been recently referenced, copies them out to swap, then adds the pages to the free page list. This is referred to as a page-out. A page fault occurs when a process tries to access a page that is not currently in memory. The page will then be copied into RAM via a page-in, either from the swap space or from the executable on disk.
On systems with very demanding memory needs (for example, systems that run many large
processes), the paging daemons can become so busy swapping pages in and out, that the
system spends all of its time paging, and not enough time running processes. When this
happens, system performance degrades rapidly. At this point, the system is said to be thrashing. If you suspect that your system may be thrashing, check the ps output to see how much CPU time the vhand process is using. If vhand is consuming a large amount of CPU time, consider purchasing more physical memory!

The term swap dates back to early UNIX implementations that managed physical memory
resources by moving entire processes between main memory and secondary storage. Most
modern virtual memory systems today no longer swap entire processes, because this method causes the system to spend most of its time processing I/O instead of doing real work.
Swapping has been replaced by a deactivation scheme, which allows pages to be pushed out
over time by a paging mechanism. Paging is a more efficient memory resource management
mechanism for virtual memory.
When the system begins thrashing, or when free memory falls below another threshold,
known as minfree, the swapper becomes active. The swapper deactivates processes,
which prevents them from running, and thus reduces the rate at which new pages are
accessed. This gives vhand an opportunity to send the unreferenced pages out to swap, and
free pages in physical memory. When swapper detects that available memory has risen
above the minfree threshold and the system is no longer thrashing, it will reactivate the deactivated processes

Work is life, you know, and without it, there's nothing but fear and insecurity.