You are not logged in.

#1 2018-04-04 10:02:09

ptersilie
Member
Registered: 2012-09-05
Posts: 13

Xorg 99% cpu usage when switching to workspace with GVIM

On my desktop machine I've noticed a weird issue that when I switch from a workspace with firefox focused to a workspace with gvim, then Xorg's CPU usage increases to 99% when scrolling in GVIM. If I alt+tab to another terminal and back to gvim, CPU usage becomes normal again. This does not happen if I switch from a workspace focusing a terminal back to the gvim workspace. It also doesn't happen if I use vim. I've tried to get to the bottom of this but am unsure what I am looking for. My desktop machine is identical to my laptop (i.e. same configuration/dot files). The only difference is that the desktop has a nvidia card, so I'm inclined to blame their drivers. But it is a bit of a stretch.

Has anyone experienced something similar or has any ideas where I can look to find the problem?

Last edited by ptersilie (2018-04-04 10:31:16)

Offline

#2 2018-04-04 11:39:27

seth
Member
Registered: 2012-09-03
Posts: 50,970

Re: Xorg 99% cpu usage when switching to workspace with GVIM

Rule out the WM and (in case) compositor to be the culprits and then yes, sure - this can easily be the driver. So switch to/from the modesetting driver for comparism.

Offline

#3 2018-04-04 21:02:41

ptersilie
Member
Registered: 2012-09-05
Posts: 13

Re: Xorg 99% cpu usage when switching to workspace with GVIM

Thanks, I played around with a few more settings and figured out that the cpu usage depends on my window manager theme. I'm using XFCE. If I'm using a theme like Arc-Dark, Arc-Darker or Numix, scrolling in Gvim eats 99% of CPU. If I use other themes, like XFCE's default, Arc, Redmond, everything is fine (scrolling in Gvim uses around 20-40% CPU). I have turned off XFCE's compositor and also tried to use compton instead, without success. I haven't tried another window manager yet, which I'll try next.

Offline

#4 2018-04-04 21:22:26

seth
Member
Registered: 2012-09-03
Posts: 50,970

Re: Xorg 99% cpu usage when switching to workspace with GVIM

Window manager (xfwm4?) or gtk theme?

Offline

#5 2018-04-04 21:27:52

ptersilie
Member
Registered: 2012-09-05
Posts: 13

Re: Xorg 99% cpu usage when switching to workspace with GVIM

I quickly checked another window manager, awesome, and it doesn't have the same problem. But I somewhat expected that since it doesn't use any themes. I now wonder if the themese that cause this issue are all GTK-3, but I haven't figured out yet which ones are. A bit of a weird one is Arc vs Arc-Dark, which I thought was the same theme with different colours. I don't think the themes are to blame though, since they work fine on my laptop. I guess it's some feature that some of the themes use that trigger a bug in the rendering engine. But I don't really know where to look further.

Offline

#6 2018-04-04 21:42:39

seth
Member
Registered: 2012-09-03
Posts: 50,970

Re: Xorg 99% cpu usage when switching to workspace with GVIM

Wild guess: you certainly have a taskbar, do you? And when changing your "theme", the taskbar changes its appearance?
What if you remove the taskbar?

Offline

#7 2018-04-05 10:35:05

ptersilie
Member
Registered: 2012-09-05
Posts: 13

Re: Xorg 99% cpu usage when switching to workspace with GVIM

I removed the taskbar (xfce4-panel) to no avail. I noticed however the the CPU load only happens if there is at least one terminal open. If I close every terminal the CPU load when scrolling is normal. If I open a terminal, switch to another workspace and then back to the Gvim workspace, scrolling in GVIM has 99% load again. This behaviour is really strange.

Offline

#8 2018-04-05 10:48:18

seth
Member
Registered: 2012-09-03
Posts: 50,970

Re: Xorg 99% cpu usage when switching to workspace with GVIM

This will probably not happen if you SIGSTOP the terminal process?
What VTE is that in particular and do you get it w/ xterm or urxvt as well?

Offline

#9 2018-04-05 12:48:53

ptersilie
Member
Registered: 2012-09-05
Posts: 13

Re: Xorg 99% cpu usage when switching to workspace with GVIM

The terminal is not running any process. It's just an open terminal. I'm using xfce4-terminal. This doesn't happen if I use xterm. I've also just noticed, that the problem also doesn't happen if I maximise or minimise the terminal window. Only if it's visible and not maximised does the CPU problem occur. This is getting stranger the more I find out about it.

Edit: Also after switching the workspace and the cpu problem happens, a quick focus to the terminal window and back to gvim fixes the problem as well.

Last edited by ptersilie (2018-04-05 12:50:42)

Offline

#10 2018-04-05 12:59:24

seth
Member
Registered: 2012-09-03
Posts: 50,970

Re: Xorg 99% cpu usage when switching to workspace with GVIM

No, I meant the process of the terminal emulator (ie. xfce4-terminal) - NOT bash/zsh (which the terminal btw. *will* be running ;-)

Offline

#11 2018-04-05 14:00:43

ptersilie
Member
Registered: 2012-09-05
Posts: 13

Re: Xorg 99% cpu usage when switching to workspace with GVIM

Ah I see what you mean now. I SIGSTOP'ed all open xfce4-terminals, but the problem remained the same.

Offline

Board footer

Powered by FluxBB