unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Óscar Fuentes" <ofv@wanadoo.es>
Cc: emacs-devel@gnu.org
Subject: Re: Emacs memory management and sluggishness
Date: Sat, 27 Jul 2019 09:55:19 +0300	[thread overview]
Message-ID: <83d0hwm0fc.fsf@gnu.org> (raw)
In-Reply-To: <87k1c44n7y.fsf@telefonica.net> (message from Óscar Fuentes on Fri, 26 Jul 2019 21:20:17 +0200)

> 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.)  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?

> 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)

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.



  reply	other threads:[~2019-07-27  6:55 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 [this message]
2019-07-27 12:36   ` Óscar Fuentes
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83d0hwm0fc.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=ofv@wanadoo.es \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).