all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Óscar Fuentes" <ofv@wanadoo.es>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Emacs memory management and sluggishness
Date: Sat, 27 Jul 2019 14:36:25 +0200	[thread overview]
Message-ID: <87ef2b4pti.fsf@telefonica.net> (raw)
In-Reply-To: <83d0hwm0fc.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 27 Jul 2019 09:55:19 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Óscar Fuentes <ofv@wanadoo.es>
>> Date: Fri, 26 Jul 2019 21:20:17 +0200
>> 
>> Since a week or two typing normal text (i.e. writing this message) even
>> in Fundamental Mode shows an annoying lag betwenn the keypress and the
>> character showing on the screen. Sometimes it affects entire key
>> sequences, and I'm no fast typist.
>
> Is there any correlation between the lag and the GC cycles?  (Turn on
> garbage-collection-messages to see.)

Ok. Too bad that the gc messages are not appended to *Messages*.

Indeed, the lag is caused by gc.

> If it does, then there's only
> one problem to investigate: why you have frequent GC cycles.
>
> And what is your value of gc-cons-threshold?

(setq gc-cons-threshold (* 20 1000 1000))

setting it to (* 2 1000 1000)) shortens the gc pauses, but I have the
impression that they occur with the same frecuency.

>> So my questions are: do we have a problem with memory fragmentation?
>
> We shouldn't have.  However, there's a question whether the particular
> development snapshot of a month ago you are using had some
> memory-related bug.
>
>> ((conses 16 4505904 1124616)
>>  (symbols 48 76877 18)
>>  (strings 32 340997 83083)
>>  (string-bytes 1 10456288)
>>  (vectors 16 688370)
>>  (vector-slots 8 24140524 2173062)
>>  (floats 8 1621 1825)
>>  (intervals 56 112123 94665)
>>  (buffers 992 449))
>> 
>> I wonder how this ends using 1.1 GB of RSS.
>
> It doesn't.  But all these measures don't include the memory we
> allocate directly, not via Lisp objects.
>
> Also, can you tell how many bytes of text do you have in all your
> buffers?  E.g., with this toy program:
>
>   (let ((stext 0))
>     (dolist (b (buffer-list))
>       (setq stext (+ stext (buffer-size))))
>     stext)

416484 (#o1455344, #x65ae4)

> Having said all that, it isn't clear to me that an RSS of 1.1 GB per
> se is something exceptional in a long-running session.  E.g., the
> Emacs 26.2.90 session where I'm typing this, which is running for 44
> days, shows an RSS of 360 MB with VM Size of 514 MB, and this is a
> 32-bit build of Emacs --with-wide-int.  So your 1.1 GB is not
> necessarily a sign of a problem.

Until now my experience was similar. Emacs memory usage increased
steadily to about 400 MB but then it stayed there. This is the first time
that I see it over 1 GB. The largest memory usage I observed until now
was 700 MB, but that was visiting very large PDF files and navigating
through many pages.

Since my previous message RSS increased 30 MB.



  reply	other threads:[~2019-07-27 12:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-26 19:20 Emacs memory management and sluggishness Óscar Fuentes
2019-07-27  6:55 ` Eli Zaretskii
2019-07-27 12:36   ` Óscar Fuentes [this message]
2019-07-27 13:20     ` Eli Zaretskii
2019-07-27 23:52       ` Óscar Fuentes
2019-07-28  2:38         ` Eli Zaretskii
2019-07-31 20:54           ` Joseph Mingrone
2019-07-31 22:00             ` Óscar Fuentes
2019-07-31 22:14               ` Joseph Mingrone
2019-07-31 22:19                 ` Óscar Fuentes
2019-07-31 22:27                   ` Joseph Mingrone
2019-08-01  2:43                     ` Eli Zaretskii
2019-08-01  9:46                       ` Joseph Mingrone
2019-08-01 13:49                         ` Eli Zaretskii
2019-08-10  2:28                           ` Joseph Mingrone
2019-08-10  7:43                             ` Eli Zaretskii
2019-08-11 20:30                               ` Joseph Mingrone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ef2b4pti.fsf@telefonica.net \
    --to=ofv@wanadoo.es \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.