Bug#448807: gnome-terminal memory management

Enrico Zini enrico at enricozini.org
Wed Dec 3 13:02:46 UTC 2008


Hello,

I experience the same memory hogging with gnome-terminal.  In fact, in
my system, long-running gnome-terminals are the applications that use up
the highest amount of memory.

I did set scrollback to large values (50000 lines, 32421Kb), but the
memory used hardly matches that.  The terminal I'm using, with 3 tabs
open, has this memory footprint at the moment:

  VIRT  RES  SHR
  666m  63m  11m

I can go in every tab and type 'reset' to clear the scrollback: it
spends maybe a minute messing through swap, it clears the scrollback,
and it leaves the memory usage unchanged.

I tried to monitor (via ps aux) the memory usage of a terminal with
several tabs open, as I was closing them one by one:

$ ps axuwww|grep 26142 (repeated)
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
enrico   26142  0.0  9.3 571008 191252 ?       Sl   Oct16  22:13 gnome-terminal
enrico   26142  0.0  9.3 571008 191420 ?       Sl   Oct16  22:13 gnome-terminal
enrico   26142  0.0  9.3 571008 191476 ?       Sl   Oct16  22:13 gnome-terminal
enrico   26142  0.0  9.3 571008 191536 ?       Sl   Oct16  22:13 gnome-terminal
enrico   26142  0.0  9.3 571008 191748 ?       Sl   Oct16  22:13 gnome-terminal
enrico   26142  0.0  9.3 571008 191940 ?       Sl   Oct16  22:13 gnome-terminal
enrico   26142  0.0  9.3 571008 192328 ?       Sl   Oct16  22:13 gnome-terminal
enrico   26142  0.0  9.3 571008 192424 ?       Sl   Oct16  22:13 gnome-terminal
enrico   26142  0.0  9.3 571008 192964 ?       Sl   Oct16  22:13 gnome-terminal
enrico   26142  0.0  9.3 571008 193096 ?       Sl   Oct16  22:13 gnome-terminal
enrico   26142  0.0  9.4 571008 193312 ?       Sl   Oct16  22:13 gnome-terminal
enrico   26142  0.0  9.4 571008 193544 ?       Sl   Oct16  22:13 gnome-terminal

Closing tabs, the memory usage seems to go UP instead of down.

I ran "valgrind --leak-check=full gnome-terminal", then I opened a new
tab, generated some backscroll with a "find /", closed the tab and
closed the terminal.  Please find attached the results, this is the
summary:

==24563== LEAK SUMMARY:
==24563==    definitely lost: 37,962 bytes in 66 blocks.
==24563==    indirectly lost: 110,480 bytes in 3,455 blocks.
==24563==      possibly lost: 170,000 bytes in 145 blocks.
==24563==    still reachable: 63,587,633 bytes in 91,734 blocks.
==24563==         suppressed: 0 bytes in 0 blocks.
 

Ciao,

Enrico

-- 
GPG key: 1024D/797EBFAB 2000-12-05 Enrico Zini <enrico at debian.org>
-------------- next part --------------
$ valgrind --leak-check=full gnome-terminal --disable-factory
==24563== Memcheck, a memory error detector.
==24563== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==24563== Using LibVEX rev 1854, a library for dynamic binary translation.
==24563== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==24563== Using valgrind-3.3.1-Debian, a dynamic binary instrumentation framework.
==24563== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==24563== For more details, rerun with: -v
==24563== 
==24563== Conditional jump or move depends on uninitialised value(s)
==24563==    at 0xBF1614E: XftFontInfoEqual (in /usr/lib/libXft.so.2.1.2)
==24563==    by 0xBF164AC: XftFontOpenInfo (in /usr/lib/libXft.so.2.1.2)
==24563==    by 0xBF16B7D: XftFontOpenPattern (in /usr/lib/libXft.so.2.1.2)
==24563==    by 0x60E585F: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x60E6846: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x60C2A82: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x60C46F6: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x7A63DEE: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A76517: (within /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A780ED: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A78451: g_signal_emit_by_name (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x65892C7: (within /usr/lib/libgtk-x11-2.0.so.0.1200.11)
==24563== 
==24563== Conditional jump or move depends on uninitialised value(s)
==24563==    at 0xBF164AF: XftFontOpenInfo (in /usr/lib/libXft.so.2.1.2)
==24563==    by 0xBF16B7D: XftFontOpenPattern (in /usr/lib/libXft.so.2.1.2)
==24563==    by 0x60E585F: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x60E6846: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x60C2A82: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x60C46F6: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x7A63DEE: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A76517: (within /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A780ED: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A78451: g_signal_emit_by_name (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x65892C7: (within /usr/lib/libgtk-x11-2.0.so.0.1200.11)
==24563==    by 0x64E2255: (within /usr/lib/libgtk-x11-2.0.so.0.1200.11)
==24563== 
==24563== Use of uninitialised value of size 8
==24563==    at 0xBF15642: (within /usr/lib/libXft.so.2.1.2)
==24563==    by 0x60E5C2E: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x60E61FA: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x60D978A: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x60C57FB: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x7A63DEE: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A768DB: (within /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A780ED: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A785F2: g_signal_emit (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x6640441: gtk_widget_unrealize (in /usr/lib/libgtk-x11-2.0.so.0.1200.11)
==24563==    by 0x644FB19: (within /usr/lib/libgtk-x11-2.0.so.0.1200.11)
==24563==    by 0x6644270: (within /usr/lib/libgtk-x11-2.0.so.0.1200.11)
==24563== 
==24563== Use of uninitialised value of size 8
==24563==    at 0xBF156C4: (within /usr/lib/libXft.so.2.1.2)
==24563==    by 0x60E5C2E: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x60E61FA: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x60D978A: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x60C57FB: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x7A63DEE: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A768DB: (within /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A780ED: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A785F2: g_signal_emit (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x6640441: gtk_widget_unrealize (in /usr/lib/libgtk-x11-2.0.so.0.1200.11)
==24563==    by 0x644FB19: (within /usr/lib/libgtk-x11-2.0.so.0.1200.11)
==24563==    by 0x6644270: (within /usr/lib/libgtk-x11-2.0.so.0.1200.11)
==24563== 
==24563== ERROR SUMMARY: 28 errors from 4 contexts (suppressed: 403 from 3)
==24563== malloc/free: in use at exit: 63,906,075 bytes in 95,400 blocks.
==24563== malloc/free: 484,036 allocs, 388,636 frees, 196,998,539 bytes allocated.
==24563== For counts of detected errors, rerun with: -v
==24563== searching for pointers to 95,400 not-freed blocks.
==24563== checked 43,164,496 bytes.
==24563== 
==24563== 
==24563== 22 bytes in 1 blocks are definitely lost in loss record 14 of 207
==24563==    at 0x4C20FEB: malloc (vg_replace_malloc.c:207)
==24563==    by 0x7CDCB82: g_malloc (in /usr/lib/libglib-2.0.so.0.1600.6)
==24563==    by 0x7CF548D: g_strdup (in /usr/lib/libglib-2.0.so.0.1600.6)
==24563==    by 0x6504729: (within /usr/lib/libgtk-x11-2.0.so.0.1200.11)
==24563==    by 0x6504A9F: (within /usr/lib/libgtk-x11-2.0.so.0.1200.11)
==24563==    by 0x60C89B7: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x7A63E9C: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A76517: (within /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A780ED: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A785F2: g_signal_emit (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x66404F5: gtk_widget_realize (in /usr/lib/libgtk-x11-2.0.so.0.1200.11)
==24563==    by 0x42EA38: (within /usr/bin/gnome-terminal)
==24563== 
==24563== 
==24563== 292 (52 direct, 240 indirect) bytes in 1 blocks are definitely lost in loss record 47 of 207
==24563==    at 0x4C20FEB: malloc (vg_replace_malloc.c:207)
==24563==    by 0x825752F: (within /lib/libc-2.7.so)
==24563==    by 0x8257D06: __nss_database_lookup (in /lib/libc-2.7.so)
==24563==    by 0x1098E31F: ???
==24563==    by 0x1098F3D6: ???
==24563==    by 0x8215EA2: getpwnam_r (in /lib/libc-2.7.so)
==24563==    by 0x7D073E1: (within /usr/lib/libglib-2.0.so.0.1600.6)
==24563==    by 0x7D08B0C: g_get_user_name (in /usr/lib/libglib-2.0.so.0.1600.6)
==24563==    by 0x52E3C0C: (within /usr/lib/libgnomeui-2.so.0.2000.1)
==24563==    by 0x7A83815: g_type_create_instance (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A691FA: (within /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A69842: g_object_newv (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563== 
==24563== 
==24563== 72 bytes in 6 blocks are possibly lost in loss record 53 of 207
==24563==    at 0x4C20FEB: malloc (vg_replace_malloc.c:207)
==24563==    by 0x7CDCB82: g_malloc (in /usr/lib/libglib-2.0.so.0.1600.6)
==24563==    by 0x5E69B2C: ORBit_alloc_string (in /usr/lib/libORBit-2.so.0.1.0)
==24563==    by 0x5E6983D: CORBA_string_dup (in /usr/lib/libORBit-2.so.0.1.0)
==24563==    by 0x5E6D5CE: ORBit_copy_value_core (in /usr/lib/libORBit-2.so.0.1.0)
==24563==    by 0x5E6D3AE: ORBit_copy_value_core (in /usr/lib/libORBit-2.so.0.1.0)
==24563==    by 0x5E6D73A: ORBit_sequence_append (in /usr/lib/libORBit-2.so.0.1.0)
==24563==    by 0x5C28450: bonobo_activation_init_activation_env (in /usr/lib/libbonobo-activation.so.4.0.0)
==24563==    by 0x5C2BD92: bonobo_activation_orb_init (in /usr/lib/libbonobo-activation.so.4.0.0)
==24563==    by 0x579E372: (within /usr/lib/libgnome-2.so.0.1999.2)
==24563==    by 0x5799BCD: gnome_program_postinit (in /usr/lib/libgnome-2.so.0.1999.2)
==24563==    by 0x5799F92: (within /usr/lib/libgnome-2.so.0.1999.2)
==24563== 
==24563== 
==24563== 112 bytes in 1 blocks are possibly lost in loss record 67 of 207
==24563==    at 0x4C210C2: realloc (vg_replace_malloc.c:429)
==24563==    by 0x7CDCAAD: g_realloc (in /usr/lib/libglib-2.0.so.0.1600.6)
==24563==    by 0x5E69A3E: ORBit_realloc_tcval (in /usr/lib/libORBit-2.so.0.1.0)
==24563==    by 0x5E6D763: ORBit_sequence_append (in /usr/lib/libORBit-2.so.0.1.0)
==24563==    by 0x5C28450: bonobo_activation_init_activation_env (in /usr/lib/libbonobo-activation.so.4.0.0)
==24563==    by 0x5C2BD92: bonobo_activation_orb_init (in /usr/lib/libbonobo-activation.so.4.0.0)
==24563==    by 0x579E372: (within /usr/lib/libgnome-2.so.0.1999.2)
==24563==    by 0x5799BCD: gnome_program_postinit (in /usr/lib/libgnome-2.so.0.1999.2)
==24563==    by 0x5799F92: (within /usr/lib/libgnome-2.so.0.1999.2)
==24563==    by 0x579A1EC: gnome_program_initv (in /usr/lib/libgnome-2.so.0.1999.2)
==24563==    by 0x579A2E3: gnome_program_init (in /usr/lib/libgnome-2.so.0.1999.2)
==24563==    by 0x41AA32: (within /usr/bin/gnome-terminal)
==24563== 
==24563== 
==24563== 288 (256 direct, 32 indirect) bytes in 1 blocks are definitely lost in loss record 102 of 207
==24563==    at 0x4C20FEB: malloc (vg_replace_malloc.c:207)
==24563==    by 0x8E6992A: (within /usr/lib/libfontconfig.so.1.3.0)
==24563==    by 0x8E6A36C: (within /usr/lib/libfontconfig.so.1.3.0)
==24563==    by 0x8E6A48C: (within /usr/lib/libfontconfig.so.1.3.0)
==24563==    by 0x8E6F08E: (within /usr/lib/libfontconfig.so.1.3.0)
==24563==    by 0xD458BA2: (within /usr/lib/libexpat.so.1.5.2)
==24563==    by 0xD459AE3: (within /usr/lib/libexpat.so.1.5.2)
==24563==    by 0xD45B659: (within /usr/lib/libexpat.so.1.5.2)
==24563==    by 0xD45BD7A: (within /usr/lib/libexpat.so.1.5.2)
==24563==    by 0xD451F90: XML_ParseBuffer (in /usr/lib/libexpat.so.1.5.2)
==24563==    by 0x8E6DD38: FcConfigParseAndLoad (in /usr/lib/libfontconfig.so.1.3.0)
==24563==    by 0x8E6E01D: FcConfigParseAndLoad (in /usr/lib/libfontconfig.so.1.3.0)
==24563== 
==24563== 
==24563== 288 bytes in 1 blocks are possibly lost in loss record 103 of 207
==24563==    at 0x4C200FC: calloc (vg_replace_malloc.c:397)
==24563==    by 0x401088E: _dl_allocate_tls (in /lib/ld-2.7.so)
==24563==    by 0x7F636BA: pthread_create@@GLIBC_2.2.5 (in /lib/libpthread-2.7.so)
==24563==    by 0xA9541E9: (within /usr/lib/libgthread-2.0.so.0.1600.6)
==24563==    by 0x7CFCB8B: g_thread_create_full (in /usr/lib/libglib-2.0.so.0.1600.6)
==24563==    by 0x7CD2D4A: (within /usr/lib/libglib-2.0.so.0.1600.6)
==24563==    by 0x7CD3EDC: g_child_watch_source_new (in /usr/lib/libglib-2.0.so.0.1600.6)
==24563==    by 0x7CD6D44: g_child_watch_add_full (in /usr/lib/libglib-2.0.so.0.1600.6)
==24563==    by 0x60C2747: (within /usr/lib/libvte.so.9.2.18)
==24563==    by 0x4287A2: (within /usr/bin/gnome-terminal)
==24563==    by 0x4251DB: (within /usr/bin/gnome-terminal)
==24563==    by 0x41A3DB: (within /usr/bin/gnome-terminal)
==24563== 
==24563== 
==24563== 2,184 bytes in 36 blocks are possibly lost in loss record 154 of 207
==24563==    at 0x4C200FC: calloc (vg_replace_malloc.c:397)
==24563==    by 0x7CDCB29: g_malloc0 (in /usr/lib/libglib-2.0.so.0.1600.6)
==24563==    by 0x7A7BB24: (within /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A7BB99: (within /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A7F419: g_type_register_fundamental (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A88F3D: (within /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x7A7E27F: g_type_init_with_debug_flags (in /usr/lib/libgobject-2.0.so.0.1600.6)
==24563==    by 0x579A290: gnome_program_init (in /usr/lib/libgnome-2.so.0.1999.2)
==24563==    by 0x41AA32: (within /usr/bin/gnome-terminal)
==24563==    by 0x81971A5: (below main) (in /lib/libc-2.7.so)
==24563== 
==24563== 
==24563== 147,840 (37,632 direct, 110,208 indirect) bytes in 63 blocks are definitely lost in loss record 198 of 207
==24563==    at 0x4C210C2: realloc (vg_replace_malloc.c:429)
==24563==    by 0x8E698AB: (within /usr/lib/libfontconfig.so.1.3.0)
==24563==    by 0x8E6A36C: (within /usr/lib/libfontconfig.so.1.3.0)
==24563==    by 0x8E66D3A: FcFontRenderPrepare (in /usr/lib/libfontconfig.so.1.3.0)
==24563==    by 0xBCE889B: (within /usr/lib/libpangoft2-1.0.so.0.2002.3)
==24563==    by 0x782981D: (within /usr/lib/libpango-1.0.so.0.2002.3)
==24563==    by 0x7829CC7: pango_itemize_with_base_dir (in /usr/lib/libpango-1.0.so.0.2002.3)
==24563==    by 0x783195E: (within /usr/lib/libpango-1.0.so.0.2002.3)
==24563==    by 0x7832BEC: (within /usr/lib/libpango-1.0.so.0.2002.3)
==24563==    by 0xBCE57CE: pango_fc_font_create_metrics_for_context (in /usr/lib/libpangoft2-1.0.so.0.2002.3)
==24563==    by 0x8C4C3C8: (within /usr/lib/libpangocairo-1.0.so.0.2002.3)
==24563==    by 0x782F450: (within /usr/lib/libpango-1.0.so.0.2002.3)
==24563== 
==24563== 
==24563== 167,344 bytes in 101 blocks are possibly lost in loss record 199 of 207
==24563==    at 0x4C1FFCF: memalign (vg_replace_malloc.c:460)
==24563==    by 0x4C20068: posix_memalign (vg_replace_malloc.c:569)
==24563==    by 0x7CF1550: (within /usr/lib/libglib-2.0.so.0.1600.6)
==24563==    by 0x7CF270A: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.1600.6)
==24563==    by 0x7CF2805: g_slice_alloc0 (in /usr/lib/libglib-2.0.so.0.1600.6)
==24563==    by 0x4189C1: (within /usr/bin/gnome-terminal)
==24563==    by 0x41A98A: (within /usr/bin/gnome-terminal)
==24563==    by 0x81971A5: (below main) (in /lib/libc-2.7.so)
==24563== 
==24563== LEAK SUMMARY:
==24563==    definitely lost: 37,962 bytes in 66 blocks.
==24563==    indirectly lost: 110,480 bytes in 3,455 blocks.
==24563==      possibly lost: 170,000 bytes in 145 blocks.
==24563==    still reachable: 63,587,633 bytes in 91,734 blocks.
==24563==         suppressed: 0 bytes in 0 blocks.
==24563== Reachable blocks (those to which a pointer was found) are not shown.
==24563== To see them, rerun with: --leak-check=full --show-reachable=yes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20081203/2b53abf8/attachment.pgp 


More information about the pkg-gnome-maintainers mailing list