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 581380 - Consumes more and more memory over time
Consumes more and more memory over time
Status: RESOLVED FIXED
Product: dia
Classification: Other
Component: general
0.97
Other Linux
: Normal major
: 0.97.1
Assigned To: Dia maintainers
Dia maintainers
Depends on:
Blocks:
 
 
Reported: 2009-05-04 22:25 UTC by Sven
Modified: 2009-07-05 10:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixes memory leak creating when font is checked. (360 bytes, patch)
2009-06-30 18:59 UTC, Jason Childs
committed Details | Review

Description Sven 2009-05-04 22:25:39 UTC
While running, dia consumes lots of memory even if just scrolling around on a big diagram. For reproduction, just start Dia and use it for a while. Its memory consumption steadily grows by time till lack of performance. (Using Dia on a amd64 Ubuntu Jaunty)
Comment 1 Hans Breuer 2009-05-24 15:30:35 UTC
I've tried to reproduce with the few information you gave but can't make Dia consume more and more memory - on a Gentoo 64. Of course there may be some memory leak left, but given that Dia comes with ~870 different objects I don't think it is feasible to guess which ones you used.
Could you attach your "big diagram" so that I can try to reproduce with that?
Comment 2 Jason Childs 2009-06-20 15:26:45 UTC
I've compiled both 0.97-pre3 and the git repository 2d932c4764cc1402075d62f86d19a18e30cbd8e7.  I get a memory leak just by opening dia creating a single object and moving it around the screen at a very fast rate.  Dia dies with:

Pango-ERROR **: Unable to open font file /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf for font DejaVu Serif 15.359375, exiting

aborting...
Aborted

It happens with just one object on the screen moving around and can be any object.  I'm running Ubuntu 9.04 32-bit.
Comment 3 Hans Breuer 2009-06-28 16:08:19 UTC
Not that I think it matters here, but choosing between a prelease and the current development version is not the road to stabiity. But now that you have the development version you may also install valgrind, do "configure --enable-debug" and provide the output of:

valgrind --num-callers=16 --leak-check=full --log-file=dia-leak.log /opt/bin/dia

Given that there are nearly 700 different objects included with Dia "a single object" is still not enough information. The random one I choose did not leak on move and I did not notice any huge memory consumption during daily work with dia-0-97.
Comment 4 Jason Childs 2009-06-30 18:59:11 UTC
Created attachment 137643 [details] [review]
Fixes memory leak creating when font is checked.

Hans,

Found this is the cause of the memory leak I'm seeing and applies to all object I believe.  I'm surprised this doesn't show up for you, but it may eat memory faster since I don't run with swap for various reasons.  I can now run and move any object around the screen without dia eating all my memory and crashing.

Thanks,
Jason
Comment 5 Hans Breuer 2009-06-30 19:59:33 UTC
Thanks for debugging this! The reason I did not see it is simple, I just did not use the almost obsolete libart renderer anymore, and that leak is specific to the dia_font_push_context/dia_font_pop_context only used by it.
Comment 6 Jason Childs 2009-07-01 00:14:31 UTC
Gotcha. not a problem.
Comment 7 Hans Breuer 2009-07-05 10:13:44 UTC
Fix commited to master and dia-0-97 branch:
http://git.gnome.org/cgit/dia/commit/?h=dia-0-97&id=789e022e7eee46e4235b81f79b66a4dcbe6a866f