GNOME Bugzilla – Bug 548633
Metadata refresh leaks
Last modified: 2009-06-22 06:48:22 UTC
After starting the new banshee build, it started a metadata refresh. As I had gnome-system-monitor open at the time I could see banshee's memory usage grow... from about 50mb to 117mb. I have waited some time but this does not seem to be fixed by garbage collection etc.
Setting as minor since the refresh isn't something that runs every time.
*** Bug 586498 has been marked as a duplicate of this bug. ***
As indicated in duplicate bug 586498, the same happens when re-scanning the library.
As I mentioned in the other report, these could be two different leaks; we don't know that the metadata refresh leak accounts for all the leakage of a rescan. How can I trigger a metadata refresh myself to compare the two in terms of memory leaks? Thanks!
Reverting the summary.
Okay, I've done a bunch of testing, the full report of which is in bug 586498. The conclusion is that they are separate bugs. The metadata specific part is that Banshee starts out consistently at 40MB of RAM (Resident/Writable), and after a metadata refresh goes to 350M, for a difference of 310M or 40Kb per track (8000 total). The rescan leaks an additional 20Kb of memory per track.
I added a patch to bug 586498 that reduces the memory consumption during metadata refresh.
The patch is a great improvement to metadata refreshes as well; the memory only increased 40-50MB instead of 310MB, so only 5-6KB per track. However it was a somewhat gradual increase which might indicate another smaller leak still existing.
The patch from bug 586498 is committed. I did more tests (with the patch). I modified banshee to run N subsequent metadata refreshes on startup. The memory usage increases after i-th refresh on a library with 2,100 songs are: 1: +21.4 MiB 2: +11.9 MiB 3: +2.9 MiB 4: -6.7 MiB The last number suggests that the GC finally kicks in. I then ran 100 metadata refreshes in a row. The result was +166.8 MiB, or +1.7 MiB per refresh. I'm not sure if it's a leak or the GC is just being lazy. I have lots of RAM and GC is probably taking advantage of it. I'm closing this bug as FIXED, feel free to re-open if you think it's not and have more information.
"100 metadata refreshes in a row" meanins 100 refreshes of the whole library? If that's just +1.7 per run we should be fine at this point.
(In reply to comment #10) > "100 metadata refreshes in a row" meanins 100 refreshes of the whole library? > If that's just +1.7 per run we should be fine at this point. Yep, 100 refreshes of a library with 2,100 songs.