I am running a single Windows XP guest instance on a Ubuntu Desktop Linux (8.04) host via VMWare Server (2.0.0). When I initially start up the guest, it puts roughly 1.2GB of memory resident for the process (observing RES column for vmware-vmx in top). After the vm runs for as little as 15 or 20 minutes, the resident memory goes down to ~80MB and the rest goes to swap. For reference, VIRT = 1746m, RES = 79m, SHR = 63m. I have allocated 1GB of memory for the XP guest but almost all of that is now in swap.
As you might expect, the performance of the VM gets quite sluggish at this point. Doing almost anything causes thrashing. To get performance back to an acceptable level, the VM has to be shut down and then started back up. A regular restart is not a good idea because lots of things have to be swapped back in during the startup process.
So, my question is how can I keep my Linux host from pushing all this memory to swap? The host is a Dell Optiplex 755 with a Intel Q6600 processor and 4GB of memory. It is not being taxed at all and I could easily afford to pin 2GB of memory to this XP VM if I could figure out how to.
I have read about the swappiness kernel parameter and have set vm.swappiness to 0 in /etc/sysctl.conf (and rebooted) in hopes that that would help but it seems to have made no difference. I have also tried vm.overcommit_memory = 1 and that hasn't seemed to do much either.
Anyone have any suggestions?