texmacs-dev
[Top][All Lists]
Advanced

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

Re: [Texmacs-dev] memory leak


From: Gubinelli Massimiliano
Subject: Re: [Texmacs-dev] memory leak
Date: Fri, 19 Dec 2008 11:18:40 +0100


On 19 déc. 08, at 09:42, Joris van der Hoeven wrote:

On Thu, Dec 18, 2008 at 11:06:04PM +0100, Gubinelli Massimiliano wrote:
Not yet. According to the debugging tools there is indeed a steady
growth of the allocated memory event in idle state (at much lower rate than previously) but I cannot trace it back to the qt code. Apparently
the problematic allocations come from the interpose handles
(specifically from the call to the function tmg_texmacs_time), are
small blocks of 16 bytes which get never released. This does not
happens under X11, but I do not still understand why.

Very strange; the routines tmg_texmacs_time () and texmacs_time ()
only perform a system call and allocate no memory. Could it be that
Guile is responsable for the non-released memory? Notice that you
may use Tools -> Test -> Memory information to get some memory statistics,
when using fast allocation. You may also use the scheme command (gc)
to do explicit garbage collection.

When you say that tmg_texmacs_time generates small blocks of 16 bytes
which are not released, can you be more specific and tell which calls
to tm_new or new might be responsible?



There some figures: with idle texmacs (open on the help page) and running for 1 minute I get 66kb of memory allocated half of which is due to the following calls

  40 texmacs.bin   66.02 Kb     start
39 texmacs.bin 66.02 Kb main ../../src/src/Texmacs/Texmacs/ texmacs.cpp:301 38 texmacs.bin 66.02 Kb start_guile(int, char**, void (*) (int, char**))
  37 libguile.17.dylib   66.02 Kb     scm_boot_guile
  36 libguile.17.dylib   66.02 Kb     scm_with_guile
  35 libguile.17.dylib   66.02 Kb     scm_i_with_guile_and_parent
  34 libguile.17.dylib   66.02 Kb     scm_c_with_continuation_barrier
  33 libguile.17.dylib   66.02 Kb     scm_i_with_continuation_barrier
  32 libguile.17.dylib   66.02 Kb     scm_c_catch
  31 libguile.17.dylib   66.02 Kb     c_body
  30 libguile.17.dylib   66.02 Kb     invoke_main_func
  29 texmacs.bin   66.02 Kb     new_call_back(void*, int, char**)
  28 texmacs.bin   66.02 Kb     TeXmacs_main(int, char**)
  27 texmacs.bin   66.02 Kb     gui_start_loop()
26 texmacs.bin 66.02 Kb qt_gui_rep::event_loop() ../../src/ src/Plugins/Qt/qt_gui.cpp:199 25 texmacs.bin 66.00 Kb qt_gui_rep::update() ../../src/src/ Plugins/Qt/qt_gui.cpp:177
  24 texmacs.bin   66.00 Kb     update()
  23 texmacs.bin   66.00 Kb     texmacs_interpose_handler()
22 texmacs.bin 66.00 Kb tm_server_rep::interpose_handler() ../../src/src/Texmacs/Server/ tm_server.cpp:304
  21 texmacs.bin   66.00 Kb     exec_pending_commands()
  20 texmacs.bin   66.00 Kb     call(object)
  19 texmacs.bin   66.00 Kb     call_scheme(scm_unused_struct*)
  18 texmacs.bin   66.00 Kb     TeXmacs_call_scm(arg_list*)
  17 libguile.17.dylib   66.00 Kb     scm_internal_catch
  16 libguile.17.dylib   66.00 Kb     scm_c_catch
  15 texmacs.bin   66.00 Kb     TeXmacs_lazy_call_scm(arg_list*)
  14 libguile.17.dylib   66.00 Kb     scm_internal_lazy_catch
  13 libguile.17.dylib   66.00 Kb     scm_c_with_throw_handler
  12 texmacs.bin   66.00 Kb     TeXmacs_call(arg_list*)
  11 libguile.17.dylib   66.00 Kb     scm_call_0
  10 libguile.17.dylib   66.00 Kb     scm_dapply
   9 libguile.17.dylib   66.00 Kb     deval
   8 libguile.17.dylib   66.00 Kb     deval
   7 libguile.17.dylib   66.00 Kb     deval
   6 libguile.17.dylib   33.00 Kb     deval
   5 texmacs.bin   33.00 Kb     tmg_texmacs_time()
   4 texmacs.bin   33.00 Kb     int_to_scm(int)
   3 libguile.17.dylib   33.00 Kb     scm_i_long2big
   2 libgmp.3.dylib   33.00 Kb     __gmpz_init_set_si
   1 libgmp.3.dylib   33.00 Kb     __gmp_default_allocate
   0 libSystem.B.dylib   33.00 Kb     malloc


and the other half is due to (without showing the uppert part of the stack which is the same as before)

   5 libguile.17.dylib   66.00 Kb     deval
   4 libguile.17.dylib   33.00 Kb     scm_difference
   3 libguile.17.dylib   33.00 Kb     scm_i_mkbig
   2 libgmp.3.dylib   33.00 Kb     __gmpz_init
   1 libgmp.3.dylib   33.00 Kb     __gmp_default_allocate
   0 libSystem.B.dylib   33.00 Kb     malloc

this does not happen with X11.

max




Best wishes, Joris


_______________________________________________
Texmacs-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/texmacs-dev





reply via email to

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