After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 130816 - memory leaks when rendering fonts on screen
memory leaks when rendering fonts on screen
Status: RESOLVED FIXED
Product: dia
Classification: Other
Component: general
CVS head
Other Linux
: Normal critical
: ---
Assigned To: Dia maintainers
Dia maintainers
Depends on:
Blocks:
 
 
Reported: 2004-01-07 21:15 UTC by Luc Pi
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Luc Pi 2004-01-07 21:15:55 UTC
Playing half a minute with pan/zoom diagram grew dia as big as 200Mo. Most
probably due to font rendering.

This may help, but does not solve the leak:

line 651 - lib/diagdkrenderer.c
g_object_unref(G_OBJECT(rgba));
Comment 1 Luc Pi 2004-01-08 02:02:30 UTC
Well, actually this is most probably the leaking source (although it
seems there are some more). The unref was here earlier and disappeared
during rev1.13. See,
http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&root=/cvs/gnome&subdir=dia%2Flib&command=DIFF_FRAMESET&root=/cvs/gnome&file=diagdkrenderer.c&rev1=1.12&rev2=1.13

so this is an inline patch.

(what do you use/recommand as (free) mem profiling tool ?)

Comment 2 Hans Breuer 2004-01-10 17:37:20 UTC
just started to use valgrind and the results look quite promising.
Only 'drawback' one needs to have a rather well equiped Linux/x86
machine :-)

although the below does not fix all memleaks (especially not the ones
which are by design ;-) the above mentioned one and some more are :

2004-01-10  Hans Breuer  <hans@breuer.org>

	[plugging memleaks, thanks valgrind :-]
	
	* lib/dia_xml.c (data_string) : don't leak return value
	of xmlNodeListGetString()
	
	* lib/dia_xml.c (xml_file_check_encoding) : g_free(buf)
	before returning, maybe alloca() would be the better 
	choice but anyway ;)

	* objects/custom/custom_object.c:306 : adde xmlFree(str) below
	
	* lib/font.c (dia_font_build_layout) : don't leak result
	of g_utf8_strdown()
	
	* lib/diagdkrenderer.c (draw_string) : don't leak rgba
	(this is the one which got me started using valgrind, see #130816)
	
Comment 3 Hans Breuer 2004-01-10 20:30:46 UTC
Oh, just noticed how specific the subject was, now this is fixed above :-)