Re: Extreme memory usage for gnome-panel related apps



hВ Сбт, 01/12/2007 в 22:11 +0000, Martin Ebourne пишет:
> On Fri, 30 Nov 2007 09:34:09 +0100, Mark wrote:
> > i was just looking through the system monitor to see how my memory usage
> > was doing and that gave me a impressive (negative way) result. I've made
> > a screenshot [1] of it and edited it a little.
> > ...
> > Now the notebook i'm typing this on has 1GB om memory and runs Fedora
> > fine so if i look at it that way than the ram usage is fine. but keep in
> > mind the people with less memory (256 or 512 MB's) they are gonna get a
> > hard time with this fedora. My total memory usage at the time of this
> > writing is: 432.00 MB (with GIMP on.. if that's closed than it's "just"
> > 400 MB).
> > 
> > What i'm trying to say here is that those gnome-panel applets are taking
> > up way to much memory regardless of the memory you can afford or have in
> > your computer.
> > ...
> > So.. is something gonna change with this memory abuse?
> > , 
> > [1]
> > http://img504.imageshack.us/img504/6821/screenshotsystemmonitoryh4.png
> 
> I agree with you completely about the memory usage of Fedora 8, it has 
> got VERY bloated recently.

Heh, sadly memory problems are rather complicated and hidden deeply
inside the stack thus require very experienced knowledge. From my
experience the significant amount of memory consumption can be dropped
by switching to some lightweight gtk theme like Simple.

I traced mixer applet for example with G_SLICE=always-malloc and some of
the entries look interesting. For example we spend 150 k on xml parser
we can avoid. Another 150 k are hanging in options. I'm attaching the
patch, not sure how correct is it.

The rest of the log is attached too.

Index: panel-applet.h
===================================================================
--- panel-applet.h	(revision 10707)
+++ panel-applet.h	(working copy)
@@ -199,6 +199,7 @@
 				      GNOME_CLIENT_PARAM_SM_CONNECT, FALSE,	\
 				      GNOME_PROGRAM_STANDARD_PROPERTIES,	\
 				      NULL);					\
+	g_option_context_free (context);				      	\
         retval = panel_applet_factory_main (iid, type, callback, data);		\
 	g_object_unref (program);						\
 	return retval;								\
@@ -214,6 +215,8 @@
 				      argc, argv,				\
 				      GNOME_CLIENT_PARAM_SM_CONNECT, FALSE,	\
 				      GNOME_PARAM_NONE);			\
+	g_object_set (program, GNOME_PARAM_GOPTION_CONTEXT, NULL);		\
+	g_option_context_free (context);				      	\
         retval = panel_applet_factory_main (iid, type, callback, data);		\
 	g_object_unref (program);						\
 	return retval;								\
@@ -239,6 +242,8 @@
 				      GNOME_CLIENT_PARAM_SM_CONNECT, FALSE,	\
 				      GNOME_PROGRAM_STANDARD_PROPERTIES,	\
 				      NULL);					\
+	g_object_set (program, GNOME_PARAM_GOPTION_CONTEXT, NULL);		\
+	g_option_context_free (context);				      	\
         retval = panel_applet_factory_main (iid, type, callback, data);		\
 	g_object_unref (program);						\
 	return retval;								\
@@ -260,6 +265,8 @@
 				      GNOME_PARAM_GOPTION_CONTEXT, context,	\
 				      GNOME_CLIENT_PARAM_SM_CONNECT, FALSE,	\
 				      GNOME_PARAM_NONE);			\
+	g_object_set (program, GNOME_PARAM_GOPTION_CONTEXT, NULL);		\
+	g_option_context_free (context);				      	\
         retval = panel_applet_factory_main (iid, type, callback, data);		\
 	g_object_unref (program);						\
 	return retval;								\
==6802== 
==6802== 92,305 bytes in 141 blocks are still reachable in loss record 197 of 201
==6802==    at 0x40051F9: malloc (vg_replace_malloc.c:149)
==6802==    by 0x5B2B2C: (within /usr/lib/libfreetype.so.6.3.8)
==6802==    by 0x5B7660: FT_Alloc (in /usr/lib/libfreetype.so.6.3.8)
==6802==    by 0x5B7B06: FT_New_Library (in /usr/lib/libfreetype.so.6.3.8)
==6802==    by 0x5B2EB6: FT_Init_FreeType (in /usr/lib/libfreetype.so.6.3.8)
==6802==    by 0x4DC38B: (within /usr/lib/libpangocairo-1.0.so.0.1600.1)
==6802==    by 0x47B989: g_type_create_instance (in /lib/libgobject-2.0.so.0.1400.0)
==6802==    by 0x463171: (within /lib/libgobject-2.0.so.0.1400.0)
==6802==    by 0x460D8A: g_object_newv (in /lib/libgobject-2.0.so.0.1400.0)
==6802==    by 0x46192E: g_object_new_valist (in /lib/libgobject-2.0.so.0.1400.0)
==6802==    by 0x461ADF: g_object_new (in /lib/libgobject-2.0.so.0.1400.0)
==6802==    by 0x4D9B6B: pango_cairo_font_map_new (in /usr/lib/libpangocairo-1.0.so.0.1600.1)
==6802== 
==6802== 
==6802== 119,364 bytes in 1,571 blocks are still reachable in loss record 198 of 201
==6802==    at 0x40052ED: realloc (vg_replace_malloc.c:306)
==6802==    by 0x7718DA: g_realloc (in /lib/libglib-2.0.so.0.1400.0)
==6802==    by 0x4739EE: (within /lib/libgobject-2.0.so.0.1400.0)
==6802==    by 0x473B57: (within /lib/libgobject-2.0.so.0.1400.0)
==6802==    by 0x47C15C: g_type_register_static (in /lib/libgobject-2.0.so.0.1400.0)
==6802==    by 0x463B64: g_param_type_register_static (in /lib/libgobject-2.0.so.0.1400.0)
==6802==    by 0x467B6B: (within /lib/libgobject-2.0.so.0.1400.0)
==6802==    by 0x47429E: g_type_init_with_debug_flags (in /lib/libgobject-2.0.so.0.1400.0)
==6802==    by 0x474381: g_type_init (in /lib/libgobject-2.0.so.0.1400.0)
==6802==    by 0x5AA4A92: gnome_program_init (in /usr/lib/libgnome-2.so.0.1800.0)
==6802==    by 0x804ED7B: main (in /usr/libexec/mixer_applet2)
==6802== 
==6802== 
==6802== 119,764 bytes in 2,421 blocks are still reachable in loss record 199 of 201
==6802==    at 0x40051F9: malloc (vg_replace_malloc.c:149)
==6802==    by 0x5725465: xmlStrndup (in /usr/lib/libxml2.so.2.6.27)
==6802==    by 0x572560B: xmlStrdup (in /usr/lib/libxml2.so.2.6.27)
==6802==    by 0x56B0D49: xmlNewCharEncodingHandler (in /usr/lib/libxml2.so.2.6.27)
==6802==    by 0x56B0E91: xmlInitCharEncodingHandlers (in /usr/lib/libxml2.so.2.6.27)
==6802==    by 0x56B12E8: xmlGetCharEncodingHandler (in /usr/lib/libxml2.so.2.6.27)
==6802==    by 0x56DAF1C: xmlAllocParserInputBuffer (in /usr/lib/libxml2.so.2.6.27)
==6802==    by 0x56DB033: xmlParserInputBufferCreateMem (in /usr/lib/libxml2.so.2.6.27)
==6802==    by 0x56B6F39: xmlCreateMemoryParserCtxt (in /usr/lib/libxml2.so.2.6.27)
==6802==    by 0xB015E2: bonobo_ui_node_from_string (in /usr/lib/libbonoboui-2.so.0.0.0)
==6802==    by 0xAFA057: (within /usr/lib/libbonoboui-2.so.0.0.0)
==6802==    by 0x5F7E172: _ORBIT_skel_small_Bonobo_UIContainer_setNode (in /usr/lib/libbonobo-2.so.0.0.0)
==6802== 
==6802== 
==6802== 149,497 bytes in 2,652 blocks are still reachable in loss record 200 of 201
==6802==    at 0x40045EB: calloc (vg_replace_malloc.c:279)
==6802==    by 0x77197D: g_malloc0 (in /lib/libglib-2.0.so.0.1400.0)
==6802==    by 0x775952: g_option_context_new (in /lib/libglib-2.0.so.0.1400.0)
==6802==    by 0x804ECF0: main (in /usr/libexec/mixer_applet2)
==6802== 
==6802== 
==6802== 408,946 bytes in 16,377 blocks are still reachable in loss record 201 of 201
==6802==    at 0x40051F9: malloc (vg_replace_malloc.c:149)
==6802==    by 0x771A15: g_malloc (in /lib/libglib-2.0.so.0.1400.0)
==6802==    by 0x7866FA: g_slice_alloc (in /lib/libglib-2.0.so.0.1400.0)
==6802==    by 0x786DD4: g_slice_alloc0 (in /lib/libglib-2.0.so.0.1400.0)
==6802==    by 0x47B566: g_type_create_instance (in /lib/libgobject-2.0.so.0.1400.0)
==6802==    by 0x463171: (within /lib/libgobject-2.0.so.0.1400.0)
==6802==    by 0x460D8A: g_object_newv (in /lib/libgobject-2.0.so.0.1400.0)
==6802==    by 0x46192E: g_object_new_valist (in /lib/libgobject-2.0.so.0.1400.0)
==6802==    by 0x461ADF: g_object_new (in /lib/libgobject-2.0.so.0.1400.0)
==6802==    by 0xA64338: (within /usr/lib/libgdk-x11-2.0.so.0.1000.14)
==6802==    by 0xA38B9E: gdk_gc_new_with_values (in /usr/lib/libgdk-x11-2.0.so.0.1000.14)
==6802==    by 0xA40361: (within /usr/lib/libgdk-x11-2.0.so.0.1000.14)
==6802== 
==6802== LEAK SUMMARY:
==6802==    definitely lost: 496 bytes in 20 blocks.
==6802==      possibly lost: 12,852 bytes in 444 blocks.
==6802==    still reachable: 1,144,199 bytes in 29,695 blocks.
==6802==         suppressed: 0 bytes in 0 blocks.

Attachment: signature.asc
Description: =?koi8-r?Q?=FC=D4=C1?= =?koi8-r?Q?_=DE=C1=D3=D4=D8?= =?koi8-r?Q?_=D3=CF=CF=C2=DD=C5=CE=C9=D1?= =?koi8-r?Q?_=D0=CF=C4=D0=C9=D3=C1=CE=C1?= =?koi8-r?Q?_=C3=C9=C6=D2=CF=D7=CF=CA?= =?koi8-r?Q?_=D0=CF=C4=D0=C9=D3=D8=C0?=



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