XWin.exe causes a 25% CPU load on Windows 7

Jon Turney jon.turney@dronecode.org.uk
Wed Mar 22 20:05:00 GMT 2017

On 16/03/2017 15:28, Kees Dekker wrote:
> I'm running into a strange problem. On my PC (a quad core i5),
> Xwin.exe takes (in combination with svchost.exe) 25% average CPU
> load. Stopping xwin.exe, also reduces the load to almost zero (if I'm
> not doing anything else). The load is mainly on 2 CPUs (almost 50% on
> both) and 10% on the other two. Almost all the shown CPU load in
> Windows task manager are kernel times (90% of the load).
> The way how I start my (64-bit) X-server is on Windows 7 x64:
> C:\cygwin64\bin\run.exe /usr/bin/bash.exe -l -c /usr/bin/startxwin --
> -clipboard -multiwindow -silent-dup-error
> The .startxwinrc file contains nothing else than sleep 2000000000
> Even if I replace the sleep with xterm, or even remove the
> .startxwinrc file (and fall back to the default, i.e. an additional
> icon in my system tray), it does not make any difference.
> My system is also equipped with a virus scanner, but even if I
> (temporarily) disable it, it makes no difference. Xwin still takes
> 12-15% and svchost.exe takes another 8-12%. This CPU consumption is
> almost all kernel times. Even tracing with either the Windows
> resource monitor, or sysinternals process explorer does not show (for
> me) much clues. The resource monitor shows some disk I/O (< 100Kb),
> almost no network I/O (<10Kbps) but sill 25+% CPU usage. The two top
> processes on the Windows Resource monitor are Xwin.exe and
> svchost.exe (LocalSystemNetworkRestricted).
> A check with process explorer learned that almost all load of
> svchost.exe Is in uxsms.dll!ServiceMain. Xwin.exe's CPU load is in
> ig75icd64.dll!DrvSetLayerPaletteEntries+0x950. Capturing process
> traces with process monitor can be done, but Xwin.exe is just a very
> few times existent in this trace (that ran for 1 minute). The same
> applies to xinit. Svchost.exe is often in this trace, querying files
> and registry. But nothing that points to a clue (for me). May be
> wmiprvse.exe may also play a role.

This is pretty odd.

ig75icd64.dll is part of the Intel graphics driver (specifically the 
OpenGL ICD), which shouldn't be getting called at all if we have nothing 
to draw (unless the driver perhaps creates a thread for it's own purposes)

You might want to check you have the latest version of that driver, or 
if you have updated it recently, rollback to the previous version.

Given that, I suspect that using the X server option '-nowgl' might work 
around this problem.

> I know, the above information is vague, but do anyone have a
> suggestion/suggestion how to find a root cause? Unfortunately, I

If you can use a profiling tool like Very Sleepy [1] (which can read 
Cygwin DWARF debuginfo and Microsoft PDBs) to get a callstack for the 
unusual load, that might help in investigating it.

[1] https://github.com/VerySleepy/verysleepy

> don't know when this higher-than-expected CPU load occurred for the
> first time. The problem became somewhat more urgent as our IT
> department moved our systems to a newer virus scanner, that also
> seems to take (much) more resources. The combination of these two
> makes working with this PC bad.

> On 20/03/2017 07:37, Kees Dekker wrote:
>> Additional information:
>> - the high CPU load does not occur, when I use (Microsoft) RDP to
>> connect from home to my work PC. The work PC only shows the high
>> CPU load when working 'at the console'. This may be related to GUI
>> settings that are disabled when connecting with RDP (I've to do
>> more research to understand what is going on here)

Yeah, a different rendering path is probably involved when using RDP.

This suggests that the X server option '-engine 1' might also be a 

You might also like to try '-nocompositewm', as the default setting for 
that has changed in the past year.

>> - attached a cygcheck report (BTW generation took a long time, i.e. 10 minutes or so)
>> - attached Xwin.0.log
>> - attached .Xdefaults
>> - attached  .XWinrc (a dummy one, where host name have been renamed)
>> - attached .startwinrc

Thanks for these

>> Reproduction:
>> 1. fresh boot of windows
>> 2. start X-server, by calling: C:\cygwin64\bin\run.exe /usr/bin/bash.exe -l -c /usr/bin/startxwin -- -clipboard -multiwindow -silent-dup-error
>> 3. have a .XWinrc file that contains some menus, like attachment (hostnames have been renamed here to thumb names)
>> 4. observe the CPU load (as described in previous email)

I am not able to reproduce this problem, testing with W10 and Intel HD 
4600. The CPU load from XWin when idle is minimal.

Jon Turney
Volunteer Cygwin/X X Server maintainer

Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

More information about the Cygwin mailing list