emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging emacs memory management


From: Dima Kogan
Subject: Re: Debugging emacs memory management
Date: Sun, 20 Sep 2015 15:01:01 -0700

Paul Eggert <address@hidden> writes:

> Thanks for all that work.  I installed the patch after tweaking its comment 
> and 
> ChangeLog entry.

Thank you Paul. I'm continuint to dig. I found out that repeatedly
creating/destroying the first frame is far more leaky than a non-first
frame:

  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21509

This should be fixed, but in my use I always have multiple frames open,
so this isn't biting me. Even with a frame open, each new frame
create/destroy cycle leaks about 15kB. Digging into this, the leaky
malloc() path is:

  emacs-snapshot- 28044 [000] 587944.079120: probe_libc:malloc: (7fa38bffc020) 
bytes=0x1000
                     7c020 malloc (/lib/x86_64-linux-gnu/libc-2.19.so)
                    14518f allocate_vectorlike.part.19 
(/usr/bin/emacs-snapshot-lucid)
                    145ead allocate_vector (/usr/bin/emacs-snapshot-lucid)
                     a427c make_sub_char_table (/usr/bin/emacs-snapshot-lucid)
                     a4f1a sub_char_table_set_range 
(/usr/bin/emacs-snapshot-lucid)
                     a4f34 sub_char_table_set_range 
(/usr/bin/emacs-snapshot-lucid)
                     a69a8 char_table_set_range (/usr/bin/emacs-snapshot-lucid)
                     a6b40 Fset_char_table_range (/usr/bin/emacs-snapshot-lucid)
                    1c838b Fset_fontset_font (/usr/bin/emacs-snapshot-lucid)
                    1c9dfc fontset_from_font (/usr/bin/emacs-snapshot-lucid)
                     c9e50 x_new_font (/usr/bin/emacs-snapshot-lucid)
                     2534e x_set_font (/usr/bin/emacs-snapshot-lucid)
                     23e66 x_set_frame_parameters 
(/usr/bin/emacs-snapshot-lucid)
                     26ab5 x_default_parameter (/usr/bin/emacs-snapshot-lucid)
                     d03ba x_default_font_parameter 
(/usr/bin/emacs-snapshot-lucid)
                     d7f98 Fx_create_frame (/usr/bin/emacs-snapshot-lucid)
                    15f933 Ffuncall (/usr/bin/emacs-snapshot-lucid)
                    195823 exec_byte_code (/usr/bin/emacs-snapshot-lucid)
                    15f350 funcall_lambda (/usr/bin/emacs-snapshot-lucid)
                    15f72b Ffuncall (/usr/bin/emacs-snapshot-lucid)
                    195823 exec_byte_code (/usr/bin/emacs-snapshot-lucid)
                    15f72b Ffuncall (/usr/bin/emacs-snapshot-lucid)
                    160d13 Fapply (/usr/bin/emacs-snapshot-lucid)
                    15f831 Ffuncall (/usr/bin/emacs-snapshot-lucid)
                    195823 exec_byte_code (/usr/bin/emacs-snapshot-lucid)
                    15f72b Ffuncall (/usr/bin/emacs-snapshot-lucid)
                    195823 exec_byte_code (/usr/bin/emacs-snapshot-lucid)
                    15f72b Ffuncall (/usr/bin/emacs-snapshot-lucid)
                    195823 exec_byte_code (/usr/bin/emacs-snapshot-lucid)
                    15f72b Ffuncall (/usr/bin/emacs-snapshot-lucid)
                    195823 exec_byte_code (/usr/bin/emacs-snapshot-lucid)
                    15f72b Ffuncall (/usr/bin/emacs-snapshot-lucid)
                    195823 exec_byte_code (/usr/bin/emacs-snapshot-lucid)
                    15f72b Ffuncall (/usr/bin/emacs-snapshot-lucid)
                    160bb0 Fapply (/usr/bin/emacs-snapshot-lucid)
                    160d8a apply1 (/usr/bin/emacs-snapshot-lucid)
                    15df4a internal_condition_case_1 
(/usr/bin/emacs-snapshot-lucid)
                    1992e0 read_process_output (/usr/bin/emacs-snapshot-lucid)
                    1a0c6b wait_reading_process_output 
(/usr/bin/emacs-snapshot-lucid)
                     1ed86 sit_for (/usr/bin/emacs-snapshot-lucid)
                     f6b79 read_char (/usr/bin/emacs-snapshot-lucid)
                     f7534 read_key_sequence.constprop.35 
(/usr/bin/emacs-snapshot-lucid)
                     f9200 command_loop_1 (/usr/bin/emacs-snapshot-lucid)
                    15de36 internal_condition_case 
(/usr/bin/emacs-snapshot-lucid)
                     ea74c command_loop_2 (/usr/bin/emacs-snapshot-lucid)
                    15dd2a internal_catch (/usr/bin/emacs-snapshot-lucid)
                     ea709 command_loop (/usr/bin/emacs-snapshot-lucid)
                     ef133 recursive_edit_1 (/usr/bin/emacs-snapshot-lucid)
                     ef4ab Frecursive_edit (/usr/bin/emacs-snapshot-lucid)
                     148c6 main (/usr/bin/emacs-snapshot-lucid)
                     21b45 __libc_start_main 
(/lib/x86_64-linux-gnu/libc-2.19.so)

I'll do a writeup about how exactly to get that later. In the meantime,
does this speak to anybody? It looks like we're creating a new Lisp
object, so I guess the gc is supposed to clean it out. I don't (yet)
know the details about how references are managed, but maybe they're not
handled properly here. Is the recursive call to
sub_char_table_set_range() causing issues?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]