Bug 186842

Summary: Collection update eats about 3MB of memory on every run
Product: [Applications] amarok Reporter: simon
Component: Collections/LocalAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: normal CC: maximilian.kossick, mitchell, thenktor, thierry
Priority: NOR    
Version: 2.1-SVN   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description simon 2009-03-11 10:24:10 UTC
Version:           2.1-SVN (using 4.2.64 (KDE 4.2.64 (KDE 4.3 >= 20090218)), Gentoo)
Compiler:          x86_64-pc-linux-gnu-gcc
OS:                Linux (x86_64) release 2.6.26-tuxonice

hi,

i noticed that amarok becomes a real memory hog when "watch collection for changes" is enabled and there is some regular file activity (creation) in a monitored directory - even if the files are not playable files the memory footprint still grows.

after a few hours amarok is blown up to 1,2 GB, no fun then.
Comment 1 simon 2009-03-12 00:03:54 UTC
debug output during scan is quite normal, happens also with no files changed, can anyone confirm this? (i used ksysguard)

amarok: BEGIN: void ScanManager::startIncrementalScan()
amarok: BEGIN: QStringList ScanManager::getDirsToScan()
amarok: END__: QStringList ScanManager::getDirsToScan() - Took 0.73s
amarok:    GOING TO SCAN:
amarok:    Scanning nothing, return.
amarok: BEGIN: void ScanManager::writeBatchIncrementalInfoFile()
amarok: END__: void ScanManager::writeBatchIncrementalInfoFile() - Took 0.95s
amarok: END__: void ScanManager::startIncrementalScan() - Took 1.7s
Comment 2 Mark Kretschmann 2009-03-12 08:07:02 UTC
We will probably have to use the Valgrind memory debugging tool to diagnose this leakage properly. It should be able to detect the leak.
Comment 3 Thorsten Mühlfelder 2009-03-13 17:21:56 UTC
At startup Amarok 2.1svn takes about 100 MB of RAM, which I think is OK for my big music collection (~35000 files). But after running Amarok for one or two days the RAM usage increases to 1 GB.
It increases RAM usage, even if nothing is played. Every hour it adds about 25 MB.
Comment 4 Thierry Göckel 2009-03-22 13:07:18 UTC
i can confirm this behaviour with a similar sized collection.
the collection scanner keeps scanning even though nothing has been added to the (sub-)directories.. when 'watch folders' is disabled, the update colletion takes much too long as well and while scanning the cpu usage goes up to 100%.
Comment 5 Jeff Mitchell 2009-05-02 18:54:31 UTC
This should have been fixed about a week ago.  Please try recent SVN.
Comment 6 Myriam Schweingruber 2009-05-02 19:21:46 UTC
Yes, works here.