There are some fields in vmstat output, which are hard to interpret. One of them is “w” I think. Yes, from man page we know, that it is “the number of swapped out lightweight processes (LWPs) that are waiting for processing resources to finish.”. So what we ought to do if it is null?
In most cases, it means that some time ago (now?) this server is low on memory. But what can we do if we solve this problem but this value doesn’t change?
bash-3.2# vmstat 5 kthr memory page disk faults cpu r b w swap free re mf pi po fr de sr s6 sd sd sd in sy cs us sy id 0 0 84 5041144 290400 1 6 0 0 0 1176 0 0 0 0 7 4231 164 838 0 2 98 0 0 84 5041136 290456 0 0 0 0 0 376 0 0 0 0 0 4228 148 575 0 2 98 0 0 84 5041136 290456 0 0 0 0 0 0 0 0 0 0 0 4232 162 579 0 2 98 0 0 84 5041128 290448 0 0 0 0 0 0 0 0 0 0 0 4227 149 637 0 2 98
First of all we can see lwp’s from what processes are swapped :
echo "::walk thread thr |::print kthread_t t_schedflag|::grep .==0 |::evalp_pidp->pid_id" | mdb -k
Or command name :
echo "::walk thread thr |::print kthread_t t_schedflag|::grep .==0 |::evalp_user.u_comm" | mdb -k
So we know lwps of what processes are still swapped. If this number in vmstat doesn’t grow, in most cases it isn’t a problem, but for a lot of people it is alarm. So to take processes date back to memory from swap we must ask this process to do something, for example sending SIGHUP to it, or just trying to truss it. Truss will need some date about process ant it will go out from swap.