all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: larsi@gnus.org, emacs-devel@gnu.org
Subject: Re: Memory usage report
Date: Fri, 18 Sep 2020 22:15:24 +0300	[thread overview]
Message-ID: <838sd6522b.fsf@gnu.org> (raw)
In-Reply-To: <87wo0rdpud.fsf@localhost> (message from Ihor Radchenko on Sat, 19 Sep 2020 00:14:34 +0800)

> From: Ihor Radchenko <yantar92@gmail.com>
> Cc: larsi@gnus.org, emacs-devel@gnu.org
> Date: Sat, 19 Sep 2020 00:14:34 +0800
> 
> Before:
> Total in lisp objects: 77.4MB (live 47.7MB, dead 29.7MB)
> Buffer ralloc memory usage:
> 16 buffers
> 39.3kB total (23.6kB in gaps)
> 
> After:
> Total in lisp objects:  283MB (live  218MB, dead 64.7MB)
> Buffer ralloc memory usage:
> 47 buffers
> 6.79MB total (78.6kB in gaps)
> 
> This is not all the memory increase. Some part seems to be in heap.

I see almost all of the 200MB of additional memory in Lisp objects:
mainly conses, the rest in vectors and intervals (i.e. text
properties).  Where do you see evidence for a significant memory in
the heap?

I guess you could ask Org developers a question regarding this high
memory usage.  In any case, this is not what people report in
bug#43389, or so it seems.

> Also, the memory usage is even worse when org-mode is using overlays (I
> am on org-mode branch using text properties instead of overlays in org).

Looks like you have 30 Org buffers whose total size is below 10MB?  If
they use a lot of text properties and overlays, it's a small wonder
you get high memory usage.  I don't necessarily see a problem here.

> The memory consumption gets even worse after I use Emacs for several
> hours. Recently, it tend to settle around 20% (of 8Gb) with lisp objects
> taking around 1Gb.

So the interesting question is: where are those 7GB used?

> This last part is the most annoying and also difficult to track - I have
> no easy way to know if it is also caused by org-mode or it is something
> else.

The only way to investigate this is to use a good memory-mapping
utility and perhaps also a debugging malloc library.

And that is actually the bottom line here: the GBytes of memory used
by such large Emacs sessions don't seem to come from Lisp objects,
they are used up in some other way.  The question is how and where in
the code this happens.



  reply	other threads:[~2020-09-18 19:15 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 19:09 Memory usage report Lars Ingebrigtsen
2020-09-17 19:19 ` Eli Zaretskii
2020-09-17 19:28   ` Lars Ingebrigtsen
2020-09-18  6:25     ` Eli Zaretskii
2020-09-18 10:51       ` Lars Ingebrigtsen
2020-09-18 11:42         ` Eli Zaretskii
2020-09-18 11:47           ` Lars Ingebrigtsen
2020-09-18 12:40             ` Eli Zaretskii
2020-09-18 12:59               ` Lars Ingebrigtsen
2020-09-18 13:17                 ` Eli Zaretskii
2020-09-18 13:32                   ` Ihor Radchenko
2020-09-18 14:00                     ` Eli Zaretskii
2020-09-18 14:08                       ` Lars Ingebrigtsen
2020-09-18 15:15                         ` Stefan Monnier
2020-09-18 15:19                           ` Lars Ingebrigtsen
2020-09-18 15:44                             ` Eli Zaretskii
2020-09-19 14:27                               ` Lars Ingebrigtsen
2020-09-19 14:48                                 ` Eli Zaretskii
2020-09-18 15:27                         ` Eli Zaretskii
2020-09-18 14:30                       ` Ihor Radchenko
2020-09-18 15:33                         ` Eli Zaretskii
2020-09-18 15:37                           ` Lars Ingebrigtsen
2020-09-18 15:50                             ` Eli Zaretskii
2020-09-19 14:23                               ` Lars Ingebrigtsen
2020-09-18 16:14                           ` Ihor Radchenko
2020-09-18 19:15                             ` Eli Zaretskii [this message]
2020-09-19  0:29                               ` Ihor Radchenko
2020-09-19  7:51                                 ` Eli Zaretskii
2020-09-19 14:29                                   ` Lars Ingebrigtsen
2020-09-19 14:46                                     ` Eli Zaretskii
2020-09-19 14:54                                       ` Lars Ingebrigtsen
2020-09-19 15:34                                         ` Eli Zaretskii
2020-09-19 15:40                                     ` Stefan Monnier
2020-09-20  9:10                                       ` Lars Ingebrigtsen
2020-09-19 14:34                                   ` Ihor Radchenko
2020-09-19 14:53                                     ` Eli Zaretskii
2020-09-19 15:14                                       ` Ihor Radchenko
2020-09-19 15:36                                         ` Eli Zaretskii
2020-09-19 15:45                                           ` Ihor Radchenko
2020-09-19 16:05                                             ` Eli Zaretskii
2020-09-19 15:43                                     ` Stefan Monnier
2020-09-19 16:08                                       ` Ihor Radchenko
2020-09-19 16:18                                         ` Stefan Monnier
2020-09-17 19:45 ` Stefan Monnier

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=838sd6522b.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=yantar92@gmail.com \
    /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.