custodian / harbour-systemmonitor

Monitor SailfishOS for basic system activity
7 stars 10 forks source link

harbour-systemmonitord seems to be leaking memory #8

Closed monich closed 9 years ago

monich commented 9 years ago

1001_heap_changes_2

custodian commented 9 years ago

What application have you used to monitor memory usage? Daemon does not directly allocated any unsafe memory that can be leaked. This is either non-proper qobject live cycle, or sql db related cache.

monich commented 9 years ago

This is a part of the endurance report generated by crash reporter:

https://github.com/mer-qa/crash-reporter

The process memory usage snapshots are taken from /proc fs, I believe. In any case, this information is coming more or less directly from the kernel, you can trust the numbers. I suggest you to profile your daemon with valgrind. Directly or indirectly, it is leaking memory.

monich commented 9 years ago

Memory usage grows in the sqlite code. It's easy enough to notice by running your systemmonitord under valgrind --tool=massif. Nothing points to any leaks in your code. So I guess it's not directly your fault but there might be some sort of workaround for it.

monich commented 9 years ago

That's sqlite cache. The default size is 2MB. Once it reaches 2MB is stops growing. If you don't need that much cache (and you probably don't) please consider reducing it using the PRAGMA cache_size statement:

http://www.sqlite.org/pragma.html#pragma_cache_size

Not really an issue. Closing.

monich commented 9 years ago

Better yet, you don't have to do anything at all. In update13 the default sqlite cache size will be reduced from 2MB to 500KB for all processes including yours.