WPF windows using large percentage of CPU
In a few different WPF apps that I have been making recently I have noticed that when I have a window of my WPF app open and running, even if the window is doing absolutely nothing, the CPU usage for that process is around 40 - 60 % which seems incredibly high for an idle window...
I know that if my machine doesnt have a GPU then a lot of the graphical processing burden gets passed to the CPU but when nothing is even moving or happening on the window then surely there is not that much to process?
Note that it doesnt happen with all WPF windows, just the bigger ones that have bound lists etc on them.
Any ideas why this might be happening or how I can prevent it?
Re: WPF windows using large percentage of CPU
what are the specs on your computer? i've never had that problem, but ive got a beastly computer.
Re: WPF windows using large percentage of CPU
I've tried my apps on 3 different machines:
1. Work laptop - 1.8 Ghz Pentium processor, 1 GB of RAM, no GPU
2. Work PC - 2.8 Ghz Pentium processor, 3 GB of RAM, no GPU
3. Home PC - quad core 2.2 Ghz processor, 8 GB of RAM, 256 MB GPU
Needless to say my home PC doesnt have a problem with it but the WPF apps still use far more CPU than any other process when idle (and even more when actually doing something). On the home PC its about 3 or 4 % when idle, on the other two machines though it is constantly above 30% most of the time when idle. There is absolutely none of my code being executed while this is happening either, the window is literally just sat there doing nothing.
Re: WPF windows using large percentage of CPU
whats your xaml file look like? i have a couple of touch screen application that are run on computer similar to ur work computer and i havent seen anything like that before. when they are idle, it has 0% cpu usage. did you try to just keep removing the functionality from the window step by step and just see when the cpu will stop being used? and what do you mean by bigger apps with boundlists? bigger as in the screen size is bigger, or bigger as in there lots of code cause the app does alot?
Re: WPF windows using large percentage of CPU
Bigger as in there is more on screen (although there would be a bit more code in them as well).
I'll upload one of the example projects later tonight and then if you want you can try running it and take a look and see if you can see what is happening. The example I will upload just binds the listbox to an in memory list but it happens with windows that retrieve data from a database and bind to that etc as well