I have recently spent a lot of time trying to understand why the computations of my (audio) app on Windows were slowing down when I moved windows on my screen , or when I switched between workspaces. I though the CPU might just get hot and throttle, but it did not. I thought the audio thread was preempted by another thread, but it did not. I though it was interrupted by a bad graphics card driver (or wifi driver, which is very often the culprit for causing glitches in real-time audio applications), but LatencyMon told me everything was fine.

And it turns out it is just the integrated GPU of my core i7 7700 which is hogging the RAM (the integrated GPU does not have its own RAM, it is shared with the CPU). Since this is on a shitty Lenovo desktop with a single RAM stick, it does not have much bandwidth to share. What makes it even worse is that I have a 4k screen plugged into the integrated GPU, so the GPU has to move a lot of pixels.

A good way to check that is to open a simple webgl demo in the browser, preferably one that does not use much CPU, but uses a lot the GPU (the Windows task manager shows graphics for both). And then run the sisoft sandra memory benchmark with this window visible, and then with the window minimized. In the latter case, I get 11GB/s of memory bandwidth, with a latency of 24ns. But when the opengl window is visible, the bandwidth drops to "5.9G/s" and latency drops to 219ns !!

The bandwidth is divided by 2 and the latency is multiplied by 10 when the GPU is in use. That's really bad, especially if you are running a real-time audio application that needs a stable performance. Ensuring that the CPU is not throttling , and that no other application is consuming too much CPU is not enough, one has also to make sure that the integrated GPU is not killing the performance of the RAM.

I have just ordered two new sticks of RAM (in order to double the bandwidth), and a pci-express graphics card, so hopefully with these two I should be able to get stable performance even when I switch between virtual desktops...

Update: I was right, everything is solved with dual channel memory and an pci-express video card.. The spikes in the cpu load when moving windows or switching workspaces have completely disappeared.