Lenovo Thinkpad T61p with Core 2 Duo and 4GB ram
Ubuntu 8.04.1 AMD64
Base Memory Size: 512MB
Video Memory Size: 32MB
Adapter Type: PCnet-FAST III (Am79C973)
Attached to: NAT
The problem happens with hardware virtualization on or off.
Windows XP SP2
Here is the problem:
I use this VM to run a single application for one of my jobs. Everything starts normally and seems to run fine. However, after a period of time, the following all occur at once.
1. Virtualbox's CPU usage on the host climbs to 99%.
2. The system clock inside Windows XP slows down. It is as if the whole guest machine is operating in slow motion. Windows take longer to maximize and minimize.
3. The task manager inside Windows XP shows that CPU usage flutters around 10% to 30% with all of it spent in the kernel. (i.e. the red line on the graph is a hair's breadth below the green line).
After a while (30 seconds to 1 minute), the following all occur in sequence.
4. The task manager inside Windows XP shows that CPU usage drops to nearly nothing.
5. The system clock inside Windows XP speeds up to faster than normal. About 2-4 virtual seconds go by for every real second that goes by.
6. This goes on for roughly 10 to 20 seconds.
7a. The system clock inside Windows XP returns to normal speed and Virtualbox's CPU usage on the host returns to normal. After a couple of minutes, GOTO 1.
7b. GOTO 1.
Whether we reach step 7a or 7b from 6 seems to depend on how long I've been using the virtual machine.
My Attempts At A Solution
Whenever I am running the custom app I am interacting with customers paying truly horrendous rates for my time (no, I don't work in THAT industry). Consequently, I can't just ask them to hang around while I perform detailed tests on my setup.
However, I have managed to try a few things so far. Obviously I have searched the web, but I didn't find anything useful.
My gut instinct was that Windows XP was spending a lot of time swapping. That's a kernel mode operation, so it would explain the high kernel times and the amount of CPU time the Virtualbox process is using while emulating a CPU in ring 0. Due to the larger amount of RAM on the host, I wasn't seeing a flashing HDD light since the Virtualbox process would effectively be swapping between the 256MB of virtualized RAM and the host system's buffer cache for the virtual disk file (both in memory).
Also, my commit charge (200MB-300MB) was topping the amount of physical memory I had set the Windows XP VM to use (256MB). Bumping that up to 512MB of physical memory may have ameliorated the problem somewhat, but like I said: testing is difficult while I'm running the custom app.
It isn't totally unreasonable that Windows XP would still swap even when the commit charge fits in RAM, so I'm not convinced that the problem isn't swapping.
The next time I work, I'm going to try disabling the page file in Windows XP. That ought to put a stop to swapping once and for all. However, as this issue is disruping my ability to work, I'd appreciate some feedback even before I try the pagefile thing.
Questions For The Intelligent Virtualbox Community
1. Would excessive swapping inside the VM cause the symptoms that I describe on a host with plenty of RAM?
2. What else could it be?
3. How can I profile Virtualbox to find out what it's really doing with 99% of my CPU time?
I know this was a long post, so I appreciate you (yes, you!) taking the time to read it. Thanks!
Last edited by nighttimestereo
on 18. Jan 2009, 01:07, edited 1 time in total.