Subject: Re: bug#5535: 23.1.50; emacs daemon high CPU load even while ununsed

From: Dirk-Jan C. Binnema <[email-masked]>
Date: Sun, 07 Feb 2010 17:06:03 +0200

Hi Dan,

>>>>> "Dan" == Dan Nicolaescu <[email-masked]> writes:

    Dan> [email-masked] writes:
    >> I noted that Emacs (emacs --daemon) takes a lot of of CPU (up to 80%), even
    >> when I am not using it. I am starting emacs --daemon from my ~/.gnomerc, which
    >> is invoked when I start my X session.
    >> 
    >> I used strace to see what was going on:
    >> 
    >> gettimeofday({1265471350, 42334}, NULL) = 0
    >> read(0, "", 4096)                       = 0
    >> write(2, "Back to top level.", 18)      = 18
    >> write(2, "\n", 1)                       = 1
    >> poll([{fd=7, events=POLLIN}], 1, 0)     = 0 (Timeout)
    >> gettimeofday({1265471350, 42538}, NULL) = 0
    >> read(0, "", 4096)                       = 0
    >> write(2, "Back to top level.", 18)      = 18
    >> write(2, "\n", 1)                       = 1
    >> poll([{fd=7, events=POLLIN}], 1, 0)     = 0 (Timeout)
    >> gettimeofday({1265471350, 42736}, NULL) = 0
    >> read(0, "", 4096)                       = 0
    >> write(2, "Back to top level.", 18)      = 18
    >> write(2, "\n", 1)                       = 1
    >> 
    >> [...]
    >> 
    >> and this continues at high speed. Apparently, emacs calling the lisp function
    >> normal-top-level in lisp/startup.el many, many times.
  
    >> Hope this helps tracking down the issue.

    Dan> Did you have X11 emacs frames and kill the frames, or kill X11?
    Dan> If yes, then it's probably a long time bug in Gtk+ that causes this.
    Dan> http://bugzilla.gnome.org/show_bug.cgi?id=85715

I did not open any frames yet; emacs-daemon was just running in the
background.

I noticed that when I started cmdline manually, I got into some weird
semi-interactive state -- emacs was not visible, but it seemed as if emacs was
somehow interpreting my key strokes, and its output was only the echo area.

Anyway, I'll see if it can be reproduced with the newer snapshot (I have
upgraded now).

Thanks,
Dirk.

-- 
Dirk-Jan C. Binnema                  Helsinki, Finland
e:[email-masked]           w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C