Skip to content

datetime: reduce active memory usage

Christian Hergert requested to merge wip/chergert/mem-reduce into master

I started looking for a few places to test Sysprof on tracking memory allocations. gsd-datetime clocked in about 9MB and that seemed high to me. So I took a bit of a look and fixed some small leaks in libgweather first. But we can also try a few things in the datetime plugin to mitigate things further.

I'm not suggesting this go in as in, although it's fine if we do. But I'd like to start a conversation about strategies we should be using to keep long-running desktop daemons as tight as is reasonable.

These patches drop things to less than 3MB but it uses arrays instead of GList, malloc instead of gslice, an exported internal function of libgweather, and malloc_trim().

Obviously I can see that being a bit controversial from a maintenance standpoint.

Merge request reports