unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dima Kogan <dima@secretsauce.net>
To: martin rudalics <rudalics@gmx.at>
Cc: 21509@debbugs.gnu.org
Subject: bug#21509: 25.0.50; X11 error: BadPixmap when creating first emacsclient frame; and memory leak
Date: Fri, 08 Sep 2017 18:49:38 -0700	[thread overview]
Message-ID: <87vaks8wul.fsf@scrawny> (raw)
In-Reply-To: <59AE5DD1.9050602@gmx.at>

martin rudalics <rudalics@gmx.at> writes:

>  > but also
>  > massively plugged the memory leaks that were associated with new emacs
>  > frames. Awesome!
>
> IIUC your numbers of Lucid with scrollbars now coincide with the numbers
> of Lucid without scrollbars before the "fix".

No, that's not right.

Lucid with scrollbars post-fix is the blue line: memory usage is stable
as frames are created/destroyed: the leak is ~0

Lucid without scrollbars pre-fix is the green line. Memory usage is
climbing. We aren't leaking as badly as the other cases, but we ARE
leaking.

So the fix resolved the large leakages in the other cases and also the
small leakages that weren't scroll-bar-related.


> OTOH the numbers for GTK largely coincide with those of Lucid with
> scrollbars before the "fix". So X itself seems much more dominant than
> any toolkit particularities.

I don't think this is right either. Lucid with scrollbars pre-fix is the
purple line. We leak memory at a high, constant rate. GTK memory usage
(yellow) is noisy and fragmented (I bet we're invoking malloc/free much
more often). The baseline memory consumption is higher, the past that,
the leak rate isn't nearly as bad as the purple. The higher
fragmentation means that the internals of malloc() matter too: I invoked
malloc_trim() just after t=450s, and we see the memory usage dropped
sharply as a result.


> This does not explain any difference between the GTK (before the "fix")
> and Lucid (after the "fix") behaviors.  What happens with GTK when you
> allow it to delete the terminal by allowing terminal->reference_count
> drop to zero?  If it does not crash immediately, is the memory leak more
> heavy than it is now?

I haven't run that experiment, but I could do that. Probably won't get
to it for a week, though.


> Also, could you try whether changing  gc-cons-threshold  in either
> direction has any impact on the occurrence of the toolkit bug or the
> growth of the memory leak?  Once I thought that this could affect the
> frequency of the error but didn't get any conclusive results.

OK. I'll look.

By the way, if you haven't tried it yet, look at rr:

http://www.rr-project.com

It's a debugging instrumentation tool that saves a process execution
trace, and lets you replay it forwards and backwards in gdb. Could make
it possible to find heisen-problems such as this.





  reply	other threads:[~2017-09-09  1:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18  4:41 bug#21509: 25.0.50; X11 error: BadPixmap when creating first emacsclient frame; and memory leak Dima Kogan
     [not found] ` <handler.21509.B.14425512741008.ack@debbugs.gnu.org>
2015-10-02  7:32   ` bug#21509: update Dima Kogan
2017-09-03 10:15 ` bug#21509: 25.0.50; X11 error: BadPixmap when creating first emacsclient frame; and memory leak martin rudalics
2017-09-05  6:21   ` Dima Kogan
2017-09-05  8:18     ` martin rudalics
2017-09-09  1:49       ` Dima Kogan [this message]
2017-09-09  7:59         ` martin rudalics
2017-10-15  3:48           ` Dima Kogan
2017-10-15  9:40             ` martin rudalics
2017-10-15 18:24               ` Dima Kogan
2017-10-16  7:42                 ` martin rudalics
2017-10-16 16:33                   ` Dima Kogan
2017-10-17  8:58                     ` martin rudalics

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=87vaks8wul.fsf@scrawny \
    --to=dima@secretsauce.net \
    --cc=21509@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /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).