gnome-screensaver uses too much CPU

Bug #230749 reported by joosters on 2008-05-15
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GNOME Screensaver
Fix Released
gnome-screensaver (Fedora)
Fix Released
gnome-screensaver (Ubuntu)

Bug Description

Binary package hint: gnome-screensaver

gnome-screensaver on my machine is configured to just blank the screen after 10 minutes. No animations, no pretty pictures, nothing.

Yet, over an uptime of 20 days, the gnome-screensaver process shows 225 minutes of CPU time.
For comparison, gnome-terminal has 623 minutes, Xorg has 729 minutes, xemacs has 6 minutes and eclipse has 51 minutes.

Given that gnome-screensaver should be doing almost NOTHING, it seems very wrong to me that its CPU usage is so large.

This is on Ubuntu 8.04, with gnome-screensaver 2.22.2-0ubuntu1

A very quick strace of the gnome-screensaver process shows that it does a fair amount of work every time I move the mouse. I've not tried an strace while the screen is blanked, so I can't say whether more CPU is used while blanked or not.

If the CPU usage is simply because the process wakes up and does stuff every time my mouse moves by a pixel, perhaps the process should be a bit cleverer. e.g. it could sleep for 10 seconds after noticing the mouse move, before checking for further movements. That way it would still spot idle periods but wouldn't need to do lots of stuff for every little mouse twitch. The screen blanking interval would be slightly less accurate, but +/- 10 seconds for a blank time of 10 minutes surely can't be critical.

Nicola Lunghi (nicola.lunghi) wrote :

Same here... Any fix????

Changed in gnome-screensaver:
status: New → Confirmed
Luc-Ace (luc-ace) wrote :

The same behavior is observed in Fedora 9. The cpu usage is ~0% when there is no mouse movement but can range from 1% to 5% with mouse movement as observed from Gnome's System Monitor and top.

Luc-Ace (luc-ace) on 2008-08-10
Changed in gnome-screensaver:
status: New → Unknown
Changed in gnome-screensaver:
status: Unknown → New
Changed in gnome-screensaver:
importance: Undecided → Medium
status: Confirmed → Triaged

Reassigning this to the right bug. The bug watch was useless wince it was linked to a duplicate. Last comment is that the bug is already fixed in trunk.

Changed in gnome-screensaver:
status: New → Unknown
Changed in gnome-screensaver:
status: Unknown → Fix Released
Pedro Villavicencio (pedro) wrote :

this is fixed upstream now, thanks for reporting.

Changed in gnome-screensaver:
status: Triaged → Fix Committed
yarly (ih8junkmai1) wrote :

When will this be fixed in Ubuntu 8.10?

I've been trying to troubleshoot an issue with frame skipping in vlc. Every time the frame skipping occurs
there's a coinciding CPU spike by Xorg and gnome-screensaver processes. Xorg will usually spike by 7-10%
gnome-screensaver jumps by the same CPU usage approximately at the same time.

Here's a screenshot of terminal with top process that captured the CPU spike.

MMarking (cpt-mocha) wrote :

Wow, I'm so happy I found this! I had exactly the same problems as you with VLC and MythTV. I've been spending weeks on this issue blameing everyone from MythTV, nvidia, Liferea, firefox, Xorg, and pulseaudio... I even spent time swapping video cards and drivers. My eyes finally opened up and realized that gnome-screensaver was the number 5 CPU time on my system, and I don't even use a screensaver. "killall gnome-screensaver" is the perfect interim solution to these Xorg CPU spike problems. Thanks to all that reported, confirmed, and upstream fixed it. Go Linux!!

In case anyone web searches for this problem in Myth, like I was trying to do for 2 weeks, if you are having jerky playback in Myth (with Myth's internal player) and see messages similar to the following when you run "mythfronend -v playback":

NVP: Video is x.xxxx frames ahead of audio, doubling video frame interval to slow down.

NVP: Video is x.xxxxx frames behind audio (too slow), dropping frame to catch up.

If you use a nVidia card with the proprietary drivers, and you're running Ubuntu with Gnome, then gnome-screensaver is actually what's causing your problem. "killall gnome-screensaver" is your friend.

yarly (ih8junkmai1) wrote :

Nearly a month has passed since my post. Will this issue be fixed in Ubuntu 8.10 ?

Kjell Braden (afflux) wrote :

This was fixed in version 2.25.1. In intrepid (8.10, and in 9.04 too, btw!) we have version 2.24.0, so no, this will probably not get fixed, unless you propose a backport.

yarly (ih8junkmai1) wrote :

Kjell, I'm fairly new to linux, I don't know what is involved to make a backport happen. I could propose it, but I don't have the skills to implement those changes, whatever they may be.

With that said, as gnome-screensaver stands presently, it causes VLC to skip frames during a gnome-screensaver CPU spike. The only solution it appears to get around this is to kill off the gnome-screensaver process. That may be a workable solution for HTPC media centers that really don't need a screensaver at all, but for home desktop users killing gnome-screensaver removes a security component (walking away from PC, password protection) in addition to control over power savings by turning off the monitor after a predisposed length of time.

yarly (ih8junkmai1) wrote :

I also wanted to convey that even if this doesn't get fixed for Ubuntu 8.10, I think it would be a bit much to have to wait until October 2010 to finally see this issue addressed in Ubuntu 9.10. It's easy for me to request this without offering the necessary skills to fix it personally, but realistically, other Ubuntu users are experiencing similar issues. Most don't read launchpad or even ubuntuforums and would blame the OS for something they can't explain (gnome-screensaver CPU spike causing frame skipping in vlc). It took me a few weeks to track this down.

yarly (ih8junkmai1) wrote :

Correction Ubuntu 9.10 in October 2009 ^^^ sorry :o

yarly (ih8junkmai1) wrote :

It's been two weeks and no reply. Can we expect a backport for Ubuntu 8.10 or 9.04?

Ted Gould (ted) wrote :

As this was fixed in GSS 2.25.1 and Jaunty has 2.26.0 I'm marking this as Fix Released. The issue of the backport should be discussed in another bug. Thank you for reporting this issue.

Changed in gnome-screensaver (Ubuntu):
status: Fix Committed → Fix Released
yarly (ih8junkmai1) wrote :

Ted could you comment further on 2.26 in Jaunty.. Info on the overview pages lists the latest package as 2.24

Recent activity
Published in jaunty-release on 2009-04-12

Since Ted stated that this has been fixed in gnome 2.26 I am also marking this as fix released for the fedora task.

Changed in gnome-screensaver (Fedora):
status: New → Fix Released
Changed in gnome-screensaver:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.