all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* High CPU load after pressing arbitrary key (mostly in C mode)
@ 2011-08-17 15:56 Michal Sojka
  2011-08-18 11:59 ` suvayu ali
  2011-08-19 20:48 ` Ian Zimmerman
  0 siblings, 2 replies; 9+ messages in thread
From: Michal Sojka @ 2011-08-17 15:56 UTC (permalink / raw)
  To: Emacs mailing list

Hi all,

I experience a weird a problem. It appears more or less randomly,
typically after using emacs for several hours. The responsiveness of emacs
starts to be very slow. Whenever I press a key, for example to type some
character, it appears on the screen in let say half a second. By
pressing several keys fast, the CPU load goes to 100%.

This happens mostly in C mode. By switching to another mode, the
response is better but occasionally there is a long delay even in the
other modes.

I workaround this by exiting emacs and starting it again. Is there any
way how to debug such problems. For example tracing all functions that
are called when a key is pressed?

I tried to switch off font-lock-mode, but it didn't change anything.

My emacs is:
GNU Emacs 23.3.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.4), Debian.

Thanks,
Michal



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: High CPU load after pressing arbitrary key (mostly in C mode)
  2011-08-17 15:56 High CPU load after pressing arbitrary key (mostly in C mode) Michal Sojka
@ 2011-08-18 11:59 ` suvayu ali
  2011-08-18 12:08   ` Michal Sojka
  2011-08-19 20:48 ` Ian Zimmerman
  1 sibling, 1 reply; 9+ messages in thread
From: suvayu ali @ 2011-08-18 11:59 UTC (permalink / raw)
  To: Michal Sojka; +Cc: Emacs mailing list

On Wed, Aug 17, 2011 at 5:56 PM, Michal Sojka
<sojka@os.inf.tu-dresden.de> wrote:
> I workaround this by exiting emacs and starting it again. Is there any
> way how to debug such problems. For example tracing all functions that
> are called when a key is pressed?
>

My lisp know-how is not that great. However AFAIU, you can toggle debug on
quit and debug on error. Then when the slow down happens, press any
key and as the CPU load goes up hit quit (C-g). If that triggers the
debugger you could get some hints from there.

GL.

-- 
Suvayu

Open source is the future. It sets us free.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: High CPU load after pressing arbitrary key (mostly in C mode)
  2011-08-18 11:59 ` suvayu ali
@ 2011-08-18 12:08   ` Michal Sojka
  2011-08-18 12:17     ` suvayu ali
  0 siblings, 1 reply; 9+ messages in thread
From: Michal Sojka @ 2011-08-18 12:08 UTC (permalink / raw)
  To: suvayu ali; +Cc: Emacs mailing list

On 08/18/2011 01:59 PM, suvayu ali wrote:
> On Wed, Aug 17, 2011 at 5:56 PM, Michal Sojka
> <sojka@os.inf.tu-dresden.de>  wrote:
>> I workaround this by exiting emacs and starting it again. Is there any
>> way how to debug such problems. For example tracing all functions that
>> are called when a key is pressed?
>>
> My lisp know-how is not that great. However AFAIU, you can toggle debug on
> quit and debug on error. Then when the slow down happens, press any
> key and as the CPU load goes up hit quit (C-g). If that triggers the
> debugger you could get some hints from there.
Thanks for reply. I have tried this, but the backtrace was almost empty every time. It seems that C-g was processed only after the previous keys, which caused the load, were processed :-(

-Michal




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: High CPU load after pressing arbitrary key (mostly in C mode)
  2011-08-18 12:08   ` Michal Sojka
@ 2011-08-18 12:17     ` suvayu ali
  2011-08-18 12:43       ` Michal Sojka
  0 siblings, 1 reply; 9+ messages in thread
From: suvayu ali @ 2011-08-18 12:17 UTC (permalink / raw)
  To: Michal Sojka; +Cc: Emacs mailing list

On Thu, Aug 18, 2011 at 2:08 PM, Michal Sojka
<sojka@os.inf.tu-dresden.de> wrote:
> Thanks for reply. I have tried this, but the backtrace was almost empty
> every time. It seems that C-g was processed only after the previous keys,
> which caused the load, were processed :-(
>

In that case if you can replicate this with emacs -Q, its bug report time. :)

> -Michal
>

GL.

-- 
Suvayu

Open source is the future. It sets us free.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: High CPU load after pressing arbitrary key (mostly in C mode)
  2011-08-18 12:17     ` suvayu ali
@ 2011-08-18 12:43       ` Michal Sojka
  2011-08-18 13:11         ` suvayu ali
  0 siblings, 1 reply; 9+ messages in thread
From: Michal Sojka @ 2011-08-18 12:43 UTC (permalink / raw)
  To: suvayu ali; +Cc: Emacs mailing list

On 08/18/2011 02:17 PM, suvayu ali wrote:
> On Thu, Aug 18, 2011 at 2:08 PM, Michal Sojka
> <sojka@os.inf.tu-dresden.de>  wrote:
>> Thanks for reply. I have tried this, but the backtrace was almost empty
>> every time. It seems that C-g was processed only after the previous keys,
>> which caused the load, were processed :-(
>>
> In that case if you can replicate this with emacs -Q, its bug report time. :)
Hmm, but the problem appears usually after emacs runs for several hours 
and using emacs for so long without my configuration would make me crazy :-(

-Michal



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: High CPU load after pressing arbitrary key (mostly in C mode)
  2011-08-18 12:43       ` Michal Sojka
@ 2011-08-18 13:11         ` suvayu ali
  0 siblings, 0 replies; 9+ messages in thread
From: suvayu ali @ 2011-08-18 13:11 UTC (permalink / raw)
  To: Michal Sojka; +Cc: Emacs mailing list

On Thu, Aug 18, 2011 at 2:43 PM, Michal Sojka
<sojka@os.inf.tu-dresden.de> wrote:
> Hmm, but the problem appears usually after emacs runs for several hours and
> using emacs for so long without my configuration would make me crazy :-(

Yes I realised that after I hit send. Maybe you could try a binary
search on your config. I realise this will take days to figure out.
But probably worth it.

Of course the other solution to use a newer version of emacs (e.g. BZR trunk).

-- 
Suvayu

Open source is the future. It sets us free.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: High CPU load after pressing arbitrary key (mostly in C mode)
       [not found] <mailman.1500.1313609268.939.help-gnu-emacs@gnu.org>
@ 2011-08-19 17:15 ` Michael Heerdegen
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Heerdegen @ 2011-08-19 17:15 UTC (permalink / raw)
  To: Emacs mailing list

Hi,

just guessing: such an effect can be caused by settings that cause
frequent updating of the mode-line, like setting `display-time-interval'
to 1 or so.  Every redisplay of the mode-line causes the global menu
structure to be recalculated.  Do you define own menus?


Michael.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: High CPU load after pressing arbitrary key (mostly in C mode)
  2011-08-17 15:56 High CPU load after pressing arbitrary key (mostly in C mode) Michal Sojka
  2011-08-18 11:59 ` suvayu ali
@ 2011-08-19 20:48 ` Ian Zimmerman
  2011-08-22 14:49   ` Michal Sojka
  1 sibling, 1 reply; 9+ messages in thread
From: Ian Zimmerman @ 2011-08-19 20:48 UTC (permalink / raw)
  To: help-gnu-emacs


Michal> Hi all, I experience a weird a problem. It appears more or less
Michal> randomly, typically after using emacs for several hours. The
Michal> responsiveness of emacs starts to be very slow. Whenever I press
Michal> a key, for example to type some character, it appears on the
Michal> screen in let say half a second. By pressing several keys fast,
Michal> the CPU load goes to 100%.

Maybe you're using a mode that doesn't properly clean after itself,
for instance doesn't set markers to nil?

-- 
Ian Zimmerman
gpg public key: 1024D/C6FF61AD
fingerprint: 66DC D68F 5C1B 4D71 2EE5  BD03 8A00 786C C6FF 61AD
Rule 420: All persons more than eight miles high to leave the court.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: High CPU load after pressing arbitrary key (mostly in C mode)
  2011-08-19 20:48 ` Ian Zimmerman
@ 2011-08-22 14:49   ` Michal Sojka
  0 siblings, 0 replies; 9+ messages in thread
From: Michal Sojka @ 2011-08-22 14:49 UTC (permalink / raw)
  To: Ian Zimmerman, help-gnu-emacs

On Fri, 19 Aug 2011, Ian Zimmerman wrote:
> 
> Michal> Hi all, I experience a weird a problem. It appears more or less
> Michal> randomly, typically after using emacs for several hours. The
> Michal> responsiveness of emacs starts to be very slow. Whenever I press
> Michal> a key, for example to type some character, it appears on the
> Michal> screen in let say half a second. By pressing several keys fast,
> Michal> the CPU load goes to 100%.
> 
> Maybe you're using a mode that doesn't properly clean after itself,
> for instance doesn't set markers to nil?

This sounds like a useful tip, thanks. I'll try to check for markers
when the problem appears again.

-Michal



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-08-22 14:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-17 15:56 High CPU load after pressing arbitrary key (mostly in C mode) Michal Sojka
2011-08-18 11:59 ` suvayu ali
2011-08-18 12:08   ` Michal Sojka
2011-08-18 12:17     ` suvayu ali
2011-08-18 12:43       ` Michal Sojka
2011-08-18 13:11         ` suvayu ali
2011-08-19 20:48 ` Ian Zimmerman
2011-08-22 14:49   ` Michal Sojka
     [not found] <mailman.1500.1313609268.939.help-gnu-emacs@gnu.org>
2011-08-19 17:15 ` Michael Heerdegen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.