Page 1 of 1

Window Xp SP3 guest weired high CPU usage

Posted: 28. Jul 2009, 20:47
by icpup
I have encountered a weired high CPU usage in XP guest. The program is called Amibroker. It is a stock market data analysis software. This software has two modes. One is end-of-day mode, the other is real-time mode. In real-time mode, it constantly pulls market data from data suppliers. This software has been run smoothly on a native XP machine without any problem. However, on an XP virtualbox, it causes 100% CPU usage under certain condition which makes the software difficult to use. This high CPU usage only happens under real-time mode without program window minimized. If the the program window is minimized, the CPU usage drops to ~30%, which is normal. Further investigation using perfmon showed that, @100% CPU usage, the system calls/sec shoots above 1200 every 4 seconds and randomly above 4000 which cause the monitoring chart freezed, that @~30% CPU usage the system calls/sec goes above 1200 every 30 secs.

The hardware: Intel(R) Core(TM)2 Duo CPU P8400 @ 2.26GHz, 3G memory, 512M video memory
The host: Ubuntu 8.10 x86_64 with 2.6.27-14-generic SMP kernel,
The guest: XP SP3, 1CPU, VT-x enabled, 1G memory, 128M video with 3d accel. enabled, bridged network, 3.0.2 virtualbox


Any suggestion is welcomed.

Re: Window Xp SP3 guest weired high CPU usage

Posted: 28. Jul 2009, 20:53
by Sasquatch
Refreshing the virtual display can cause this kind of behaviour. Your program is refreshing so fast, that the VM can't handle it smoothly. Remember, most of the VM tasks are done in software mode, so even the 2D screen is done by CPU. This CPU usage is also reflected on the Guest performance monitors (like taskmanager).

Re: Window Xp SP3 guest weired high CPU usage

Posted: 28. Jul 2009, 23:16
by vbox4me2
Look into slowing down realtime mode via an option or something, or try a lower resolution for the Guest.

Re: Window Xp SP3 guest weired high CPU usage

Posted: 28. Jul 2009, 23:39
by wmeyer
I found that increasing the allocated memory for the virtual display seemed to help.

Re: Window Xp SP3 guest weired high CPU usage

Posted: 29. Jul 2009, 02:20
by icpup
Sasquatch wrote:Refreshing the virtual display can cause this kind of behaviour. Your program is refreshing so fast, that the VM can't handle it smoothly. Remember, most of the VM tasks are done in software mode, so even the 2D screen is done by CPU. This CPU usage is also reflected on the Guest performance monitors (like taskmanager).
I should've made myself clear in description. When I said the "monitoring chart freezed" I really mean to say that the counter of the monitoring is frozen for 1-2 secs. This counter frozen results a non-continuous chart for system calls/sec variable. If I use taskmanager instead of perfmon, I did not observe any disruption on taskmanager's graphics.

Re: Window Xp SP3 guest weired high CPU usage

Posted: 29. Jul 2009, 02:26
by icpup
vbox4me2 wrote:Look into slowing down realtime mode via an option or something, or try a lower resolution for the Guest.
There is no option to adjust the real-time timing. The software is designed to grab data as provided. Usually data are delivered every 0.2-0.3 sec. The chart screen refreshes every minute. I did try to lower resolution on the guest and found the problem still exists.

Re: Window Xp SP3 guest weired high CPU usage

Posted: 29. Jul 2009, 02:31
by icpup
wmeyer wrote:I found that increasing the allocated memory for the virtual display seemed to help.
I did increase the memory up to 2G and left 1G for the host. It did a little help. Now the program responses a little well, not much. However, the CPU usage is still @100%

Re: Window Xp SP3 guest weired high CPU usage

Posted: 29. Jul 2009, 22:34
by wmeyer
icpup wrote:I did increase the memory up to 2G and left 1G for the host. It did a little help. Now the program responses a little well, not much. However, the CPU usage is still @100%
Not what I meant. There is a setting for display memory. It defaults, in my experience, to 12MB. I increased to 64MB, and saw a marked improvement. My rationale would be to assume 4 bytes per pixel, and more than sufficient display memory to contain the display and a buffer copy. So, with 1680x1050x4, a single image buffer would be roughly 7MB. Double that, and you're talking 14MB, which is more than the base value assigned. I went to 64MB because my other display is 1920x1200x4, or over 9MB per image. I'd rather not worry about the math, or about how any of it may be consumed in other buffering operations, so set it to more than I could imagine would be needed.

Re: Window Xp SP3 guest weired high CPU usage

Posted: 30. Jul 2009, 04:26
by icpup
wmeyer wrote:
icpup wrote:I did increase the memory up to 2G and left 1G for the host. It did a little help. Now the program responses a little well, not much. However, the CPU usage is still @100%
Not what I meant. There is a setting for display memory. It defaults, in my experience, to 12MB. I increased to 64MB, and saw a marked improvement. My rationale would be to assume 4 bytes per pixel, and more than sufficient display memory to contain the display and a buffer copy. So, with 1680x1050x4, a single image buffer would be roughly 7MB. Double that, and you're talking 14MB, which is more than the base value assigned. I went to 64MB because my other display is 1920x1200x4, or over 9MB per image. I'd rather not worry about the math, or about how any of it may be consumed in other buffering operations, so set it to more than I could imagine would be needed.
Thanks for the clarification. I have set 128M for the virtualbox video. Nevertheless, I have tried to reduce the screen size . Still the same problem. I think this 100% CPU usage is not related to the screen resolution or refresh rate, but I can't figure out which one caused it.

Re: Window Xp SP3 guest weired high CPU usage

Posted: 30. Jul 2009, 10:37
by vbox4me2
Run processexplorer in the Guest.

Re: Window Xp SP3 guest weired high CPU usage

Posted: 30. Jul 2009, 16:41
by icpup
vbox4me2 wrote:Run processexplorer in the Guest.
Processexplorer showed above 90% CPU for the amibroker while the application is not minimized and ~50% for system process (PID #4) and <3% for the amibroker while amibroker is minimized. On a native XP system, processexplorer showed ~30% CPU for the amibroker while the application is not minimized.