unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Emacs memory management and sluggishness
@ 2019-07-26 19:20 Óscar Fuentes
  2019-07-27  6:55 ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Óscar Fuentes @ 2019-07-26 19:20 UTC (permalink / raw)
  To: emacs-devel

[I sent this message through gmane hours ago and so far it was not
posted, sorry for the duplicate if it finally arrives]

GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit) of
2019-06-29

M-x emacs-runtime says this session is running for 26 days. Light usage.
Right now its RSS is 1.1 GB. I don't open huge files (rarely they are
larger than 200 KB, except for Gnus (?) opening sent-news and sent-mail,
which are about 5MB each). Sometimes I read PDF documents with
PDF-Tools, which amounts to an image-viewer plus the length of the PDF
file, being the largest one 6 MB.

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.

So my questions are: do we have a problem with memory fragmentation?
because with the same usage pattern the memory keeps growing.

And could this cause the lag I described above? At this moment, simply
typing text makes Emacs CPU usage go over 50% of a core (on a fast
desktop machine). This does not happen on a fresh instance with the same
configuration. I see the lag increases on correlation with the memory
increase. Apart from Evil-mode, I have no other edition-related modes
apart from what Emacs itself activates, and disabling Evil makes no
difference.

P.S.: profiling indicates that about 80% of the CPU samples are on
Automatic GC. Maybe the cause is running the GC over such large memory
area.

(garbage-collect) returns

((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.

(memory-limit) returns

1874140 (#o7114334, #x1c98dc)

(memory-use-counts) returns

(3617372752 2210912 8232217138 506599 2689836943 19615159 67629016)

gc-elapsed returns

1901.1549781709962

htop says that emacs used 2h38m of CPU so far.



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

end of thread, other threads:[~2019-08-11 20:30 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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