In Linux, for a 8GB RAM server, when could we say virtual memory is actually used more? I.e., what is the number of page faults which says system is using more virtual memory?
Of course yes, Virtual Memory (known as Swap in Linux) will be used less when there is enough memory.
There is a kernel parameter called
swappiness that controls how much swap is likely to be used. Tune it to your needs. To see current value (all commands need root):
and to set the value
and to persist it, open
/etc/sysctl.conf and add (or change)
More information here.
Consider value as percent, and less value means using less swap.
On my laptop with 16GB RAM, using 10 I'm just fine.