09 June 2007

Freeing Memory...

From time to time you might look at the memory usage of Liferea and you might ask what does it need that much RAM for? And often it is just leakage that causes such high allocation. In fact the next release 1.2.17 will fix two leaks discovered and fixed by Hubert Figuiere.

At the moment it is quite hard to debug memory issues in Liferea because the termination code does not clean up all used memory. This makes it hard to distinguish between lost and just not free'd pieces of memory when using tools like valgrind.

And the reason why there is no complete clean up on shutdown? Laziness and poor design. In fact without having a clear object hierarchy destroying structures without knowing all implications can cause crashes. Also there are a lot of static unwrapped pseudo-global data structures without a good way to free them. And last but not least: freeing complex glib structures in C is ugly and no fun at all.

The good news: with the current 1.3.x branch I started to clean up this mess. As a first step I'll try to clean up as much data structures as possible without a major redesigns and on the long term there will be rewrites...

Want to help? But you do not have the time to write code? Do a review, look through the code and send in a code review!

1 comment:

Anonymous said...

As regards memory usage, could you add a 'Remove all read items" under the subscriptions and/or the feed menus? This would give the user more control beyond the number of feeds to save.
I also periodically delete the contents of the mozilla disk cache at ~/.liferea/mozilla/liferea/Cache/ when it gets quite large. This seems to improve performance as well. Thank you for Liferea!