On Apr 1, 2013, at 5:35 PM, Krzysztof KosiĆski wrote:
2013/4/1 mathog <mathog@...1176...>:
In brief, Inkscape at present seems to be exceedingly sloppy in how it handles memory, and I would rate the squishing of the vast majority of these memory issues as a far higher priority than the reorganization of the code.
I am guessing 95% of those are false positives caused by the use of libgc. Use the suppression file libgc.supp present in the root source control directory to remove them.
Yes, Krzysztof has hit on the main issue you're tripping up against.
Unfortunately even with the suppressions we'll not get any useful memory leak info. We can get things like uninitialized use, double frees, etc.
In general libgc will hold onto memory it grabs and reuse it later as things progress. If you want to disable the garbage collection in order to get valigrind to work better, try adding this environment variable tweak to the beginning of the line when you run it
_INKSCAPE_GC=disable valgrind...
Of course, to correct inefficient use of garbage collection, the general trick is to try to follow the chain of what is keeping objects pinned into memory. Often there will be perhaps only a single reference pinning a whole tree in place and blocking it from being collected. The other main option is to remove use of libgc altogethe, but that is probably a little more long-term.