Thursday, March 30, 2006

Zenity Memory Usage: Valgrind

So, on the latest Dapper beta, I tried running valgrind on an instance of Zenity, a fairly good example of a minimal gtk program. I noticed that stuff was getting allocated for the icon data:

==24632== 74,477 bytes in 2,864 blocks are still reachable in loss record 4,829 of 4,830
==24632==    at 0x401C422: malloc (vg_replace_malloc.c:149)
==24632==    by 0x479FF36: g_malloc (in /usr/lib/libglib-2.0.so.0.1000.1)
==24632==    by 0x47AFC65: g_strdup (in /usr/lib/libglib-2.0.so.0.1000.1)
==24632==    by 0x42BAD04: ??? (gtkicontheme.c:2161)
==24632==    by 0x42BAF11: ??? (gtkicontheme.c:1057)
==24632==    by 0x42BBC5F: gtk_icon_theme_lookup_icon (gtkicontheme.c:1244)
==24632==    by 0x42BC108: gtk_icon_theme_load_icon (gtkicontheme.c:1388)
==24632==    by 0x42B74C1: gtk_icon_set_render_icon (gtkiconfactory.c:1748)
==24632==    by 0x43D0CAB: gtk_widget_render_icon (gtkwidget.c:5337)

There were other stack traces here, accounting for over 200kb of memory. I tried regenerating my cache, this had no effect. Have to see what is going on. Also, this stack trace was very curious:

==24632== 337,656 bytes in 94 blocks are still reachable in loss record 4,830 of 4,830
==24632==    at 0x401C422: malloc (vg_replace_malloc.c:149)
==24632==    by 0x494FC0C: (within /usr/lib/libfreetype.so.6.3.8)
==24632==    by 0x41B0E9A: (within /usr/lib/libpangoft2-1.0.so.0.1200.0)
==24632==    by 0x41B6974: (within /usr/lib/libpangoft2-1.0.so.0.1200.0)
==24632==    by 0x41B237A: (within /usr/lib/libpangoft2-1.0.so.0.1200.0)
==24632==    by 0x41B4DA1: (within /usr/lib/libpangoft2-1.0.so.0.1200.0)
==24632==    by 0x41B02D1: pango_ot_info_get_gpos (in /usr/lib/libpangoft2-1.0.so.0.1200.0)
==24632==    by 0x41B0357: (within /usr/lib/libpangoft2-1.0.so.0.1200.0)
==24632==    by 0x41B0407: pango_ot_info_find_script (in /usr/lib/libpangoft2-1.0.so.0.1200.0)
==24632==    by 0x4C162E9: (within /usr/lib/pango/1.5.0/modules/pango-basic-fc.so)
==24632==    by 0x45E4D12: (within /usr/lib/libpango-1.0.so.0.1200.0)
==24632==    by 0x45F3FB3: pango_shape (in /usr/lib/libpango-1.0.so.0.1200.0)
==24632==    by 0x45E7BCE: (within /usr/lib/libpango-1.0.so.0.1200.0)
==24632==    by 0x45EAD1A: (within /usr/lib/libpango-1.0.so.0.1200.0)
==24632==    by 0x45EB274: (within /usr/lib/libpango-1.0.so.0.1200.0)
==24632==    by 0x45EBBCB: (within /usr/lib/libpango-1.0.so.0.1200.0)
==24632==    by 0x42DA876: ??? (gtklabel.c:2027)

I wonder exactly what this is that needs 300 kb of memory.

No comments: