Library Scanner eats up memory

Bug #1391178 reported by Max Linke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Critical
Max Linke

Bug Description

I noticed today that mixxx uses a large amount of memory while scanning for files (more then 5GB on my machine). Once the scanner is done the memory usage drops back to a more reasonable amount. This behavior exists since we merged the cover-art branch.

The reason for this is that the TIO objects now consume a lot more memory because they also store the cover images found while they are parsed and that we use `QObject::deleteLater` in the library scanner when constructing the TIO objects. Since Qt 4.8 `deleteLater` in a thread without event loop means that objects are deleted when the threads stops.

http://qt-project.org/doc/qt-4.8/qobject.html#deleteLater

Using a debug statement to check when a TIO is deleted shows that for the libraryscanner they are all deleted once the scanner finishes. Removing from `DeleteLater` from the TIO construction solves the memory issues for me and I see that the TIO's are deleted during the scan.

To double check my results I remove the `CoverArt` private variable from TIO and replaced the getter objects to return default classes. This also solves the memory "leak".

My current solution would be to delete the TIO's in the scanner as soon as they are out of scope. I don't know why we use `DeleteLater` in the scanner anyway. I didn't notice anything not working.

Tags: library
Revision history for this message
Max Linke (max-linke) wrote :
RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Confirmed → Fix Committed
Max Linke (max-linke)
Changed in mixxx:
assignee: nobody → Max Linke (max-linke)
RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/7638

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.