GNOME Bugzilla – Bug 581380
Consumes more and more memory over time
Last modified: 2009-07-05 10:13:44 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)
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?
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.
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.
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
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.
Gotcha. not a problem.
Fix commited to master and dia-0-97 branch: http://git.gnome.org/cgit/dia/commit/?h=dia-0-97&id=789e022e7eee46e4235b81f79b66a4dcbe6a866f