I've discovered something significant about this problem, using Sun's 1.5 JRE on a WinXP SP2 b0x.
Even if Limewire is set via Task Manager to BelowNormal or even Low priority, it will sometimes preempt other tasks -- ones at Normal and even AboveNormal priority, and sometimes even the Task Manager itself at High priority!
For example, I can run a certain game application in a window and see it using about 40% CPU in Task Manager and getting roughly 60FPS. If I run Limewire and set it to BelowNormal priority, with the game at the default (Normal) priority, it drops to around 50FPS and sometimes spikes down to 20 or occasionally locks up completely for a while. Task Manager shows the following damning statistics:
95% CPU use by Limewire
5% CPU use by the game, which normally uses more and has the higher priority
Memory usage (commit charge) well below physical RAM in b0x
Steady pf usage and similar statistics
And the drive activity light shows no significant amount of drive activity.
So, what exactly is Limewire grabbing from the game? Both are running in windows so it isn't video contention. I'm not using Limewire's media player, so only the game is using the soundcard. The low mem use and lack of HDD activity seem to indicate no swapping/thrashing and no contention for explicitly accessing disk files either. Limewire is a user input, network, and event driven app that presents a GUI which is idle at the time; the game presents a window with DirectX graphics and uses DirectInput. They can't be clashing over input then. The game is local, single player; so they are not clashing over network access (Limewire has it exclusively).
That seems to mean that the game isn't blocking on something that's busy (hdd, network, whatever) and yielding CPU to Limewire. And yet Limewire is hogging the CPU. The only explanation I can think of is that Limewire is preempting the game -- even though it has the lower priority.
Fix Limewire to respect its priority setting and let higher priority apps preempt it.
Also, fix Limewire not to frequently saturate a 1.5GHz Athlon XP. What the hell is an event-driven app doing using that much CPU anyway?! |