[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slow redisplay

From: Ergus
Subject: Re: Slow redisplay
Date: Mon, 26 Aug 2019 06:20:41 +0200
User-agent: NeoMutt/20180716

On Sun, Aug 25, 2019 at 02:10:09PM +0300, Eli Zaretskii wrote:
Date: Sun, 25 Aug 2019 12:32:51 +0200
From: Ergus <>
Cc: Eli Zaretskii <>,

With the actual master branch I am observing a very important lagging in
redisplay after being using emacs for 3-4 of hours. The rediplay happens
like in stop motion speed, I can see the redisplay line being updated
slowly and it takes sometimes like 1 seconds (from the top to the bottom
of the screen) in my best laptop.

(I only use emacs in tui) So the only solution after a while is to close
emacs and reopen again.

I used to have these lines:

(defun my/minibuffer-setup-hook ()
  (setq gc-cons-threshold most-positive-fixnum))

(defun my/minibuffer-exit-hook ()
  (setq gc-cons-threshold 800000))

(add-hook 'minibuffer-setup-hook #'my/minibuffer-setup-hook)
(add-hook 'minibuffer-exit-hook #'my/minibuffer-exit-hook)

In my config, but after removing them (because someone suggested that
the redisplay lagging could be related with the gc) the problem is still
there (less critical, but still there after some hours).

Any suggestion to find where is the issue comming from? Or what should I
see to make a better report?

If you set garbage-collection-messages non-nil, do you see any GC
messages when Emacs is lagging input?

No there is not any garbage collection message after 5 hours.

If so, does invoking "M-x
garbage-collect RET" manual fix that?

Yes, executing it manually fixes the lagging.

In my config I do.


(setq file-name-handler-alist nil
     message-log-max 16384
     gc-cons-threshold most-positive-fixnum   ;; Defer Garbage collection
     gc-cons-percentage 1.0)

(add-hook 'window-setup-hook
         (lambda ()
           (setq file-name-handler-alist file-name-handler-alist-old
                 gc-cons-threshold 800000
                 gc-cons-percentage 0.1)
            (message "Load time %.06f" (float-time (time-since my/start-time))))


(defun my/minibuffer-setup-hook ()
 (setq gc-cons-threshold most-positive-fixnum))

(defun my/minibuffer-exit-hook ()
 (setq gc-cons-threshold 800000))

(add-hook 'minibuffer-setup-hook #'my/minibuffer-setup-hook)
(add-hook 'minibuffer-exit-hook #'my/minibuffer-exit-hook)


When I actually check the variables gc-cons-threshold they are updated
properly when minibuffer is active and when not.

But it seems that the gc is not triggered because I don't see any gc
message after 5 hours and the screen is already lagging.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]