help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Question about memory usage


From: Michał Kondraciuk
Subject: Re: Question about memory usage
Date: Thu, 5 Apr 2018 20:06:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 04/04/2018 08:55 AM, Eli Zaretskii wrote:
Did you try not setting buffer-undo-list at all?  What did you see
then?

Emacs behaves as expected, i.e. memory usage is ~20MB all the time.

OK, so what is your question now?  Are you asking, like Stefan, why
setting buffer-undo-list to nil in this case makes a difference, or
are you asking a more general question (and if the latter, what are
you asking)?

I found out what the problem was:

(while t
  (with-temp-buffer
    (setq buffer-undo-list nil)
    (insert "a")
    (print (length undo-auto--undoably-changed-buffers)
           #'external-debugging-output)))

The variable undo-auto--undoably-changed-buffers was storing a lot of killed buffers. There's a timer that periodically clears this variable, but it didn't get a chance to run, since Emacs was never idle. Calling sit-for inside the loop solves this - not that it matters, because this is not "normal" code. Thanks for the responses.




reply via email to

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