[Bug 1141444] New: clementine: a memory hog
http://bugzilla.suse.com/show_bug.cgi?id=1141444 Bug ID: 1141444 Summary: clementine: a memory hog Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Other Assignee: davejplater@gmail.com Reporter: jslaby@suse.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- Created attachment 810426 --> http://bugzilla.suse.com/attachment.cgi?id=810426&action=edit clementine stdout+stderr I think, since the upgrade to a git snapshot of clementine, it eats a lot of memory. 1) it allocates 20T of virtual memory on startup. What is the reason for that? 2) it leaks memory as after a week or so, it occupies 2G of memory. It's built with -fsanitize=address. So I am attaching the output. From ext/libclementine-tagreader/tagreader.cpp: TagReader::TagReader() : factory_(new TagLibFileRefFactory), // <- one of the leaks is here network_(new QNetworkAccessManager), kEmbeddedCover("(embedded)") {} I don't see a destructor, so where are those two "new"ed memories freed? Also why do you build with -fsanitize=address: https://build.opensuse.org/package/rdiff/multimedia:apps/clementine?linkrev=base&rev=109 It does not allow running with valgrind. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c1
--- Comment #1 from Jiri Slaby
1) it allocates 20T of virtual memory on startup. What is the reason for that?
It's perhaps the memory shadow of the ASAN. So that is likely OK. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c2
--- Comment #2 from Jiri Slaby
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c3
--- Comment #3 from Dave Plater
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c4
--- Comment #4 from Jiri Slaby
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c5
Jiri Slaby
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c6
Jiri Slaby
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c7
--- Comment #7 from Dave Plater
Created attachment 810466 [details] delete the allocated mem
Maybe the third time, I will attach the correct one.
Thanks, I'm no longer using asan in home:plater/clementine the version there is the current one it includes your patch and the latest qt5 branch git. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c8
--- Comment #8 from Jiri Slaby
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c9
--- Comment #9 from Dave Plater
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c10
--- Comment #10 from Jiri Slaby
1,400 (112 direct, 1,288 indirect) bytes in 1 blocks are definitely lost in loss record 10,967 of 11,287 at 0x4836DEF: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x50F9AF1: QObject::QObject(QObject*) (qobject.cpp:807) by 0x5B309CA: QNetworkAccessCache::QNetworkAccessCache() (qnetworkaccesscache.cpp:105) by 0x5B2AFDF: QNetworkAccessManagerPrivate (qnetworkaccessmanager_p.h:102) by 0x5B2AFDF: QNetworkAccessManager::QNetworkAccessManager(QObject*) (qnetworkaccessmanager.cpp:469) by 0x7A057B: NetworkAccessManager::NetworkAccessManager(QObject*) (network.cpp:87) by 0x44618D: ArtistBiography::ArtistBiography() (artistbiography.cpp:55) by 0x50C982: ArtistInfoView::ArtistInfoView(QWidget*) (artistinfoview.cpp:29) by 0x66278E: MainWindow::MainWindow(Application*, SystemTrayIcon*, OSD*, CommandlineOptions const&, QWidget*) (mainwindow.cpp:187) by 0x3B8A0C: main (main.cpp:456)
1,816 (16 direct, 1,800 indirect) bytes in 1 blocks are definitely lost in loss record 11,000 of 11,287 at 0x4836DEF: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x7A0590: NetworkAccessManager::NetworkAccessManager(QObject*) (network.cpp:88) by 0x77827C: MusicbrainzCoverProvider::MusicbrainzCoverProvider(QObject*) (musicbrainzcoverprovider.cpp:41) by 0x7C0515: std::_Function_handler
::_M_invoke(std::_Any_data const&) (application.cpp:101) by 0x7BEAAE: UnknownInlinedFun (std_function.h:690) by 0x7BEAAE: UnknownInlinedFun (lazy.h:57) by 0x7BEAAE: UnknownInlinedFun (lazy.h:55) by 0x7BEAAE: UnknownInlinedFun (lazy.h:36) by 0x7BEAAE: Application::cover_providers() const (application.cpp:245) by 0x4F4F5E: AlbumCoverChoiceController::SetApplication(Application*) (albumcoverchoicecontroller.cpp:90) by 0x63B6A9: NowPlayingWidget::SetApplication(Application*) (nowplayingwidget.cpp:184) by 0x6672A7: MainWindow::MainWindow(Application*, SystemTrayIcon*, OSD*, CommandlineOptions const&, QWidget*) (mainwindow.cpp:244) by 0x3B8A0C: main (main.cpp:456)
There seems to be a repetitive problem with fontrendering (fontconfig), which I will into later. This perhaps makes clementine memory footprint to grow. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c13
Jiri Slaby
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c14
Jiri Slaby
I don't understand what all the QList
leaks are about.
Better to look into the valgrind report, not the ASAN's. They are UltimateLyricsReader leaks:
992 bytes in 31 blocks are possibly lost in loss record 11,742 of 12,222 at 0x483677F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4F5123F: QListData::detach_grow(int*, int) (qlist.cpp:96) by 0x67C2C5: UnknownInlinedFun (qlist.h:775) by 0x67C2C5: QList
> >::append(QList > const&) (qlist.h:601) by 0x67C682: UnknownInlinedFun (qlist.h:404) by 0x67C682: UnknownInlinedFun (ultimatelyricsprovider.h:52) by 0x67C682: UltimateLyricsReader::ParseProvider(QXmlStreamReader*) const (ultimatelyricsreader.cpp:79) by 0x67C9C2: UltimateLyricsReader::ParseDevice(QIODevice*) const (ultimatelyricsreader.cpp:51) by 0x67CB0D: UltimateLyricsReader::Parse(QString const&) const (ultimatelyricsreader.cpp:39) by 0x67CF68: non-virtual thunk to QtConcurrent::RunFunctionTask >::run() (qtconcurrentrunbase.h:119) by 0x4EFF431: QThreadPoolThread::run() (qthreadpool.cpp:99) by 0x4EFC111: QThreadPrivate::start(void*) (qthread_unix.cpp:360) by 0x78D8FA9: start_thread (pthread_create.c:486) by 0x568373E: clone (clone.S:95)
I am not sure if UltimateLyricsReader is ever deleted. Note it looks to be allocated with every song change. Also, even if it was released, I don't know, if it would delete the parser data. (I don't have time to look into it.) -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c15
Dave Plater
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c16
--- Comment #16 from Swamp Workflow Management
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c18
Manvendra Bhangui
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c19
--- Comment #19 from Jiri Slaby
The leak caused by the BOOST_SCOPE_EXIT mistake in database is a bad one, and obviously a leak. Also the QNetworkAccessManager in tagreader. But QNetworkAccessManager used everywhere else shouldn't leak.
new QNetworkAccessManager(this) is correct, because Qt objects that inherit the parent will be deleted when the parent is deleted (memory is managed by Qt).
OK, thanks for review. So could you please pick only the good pieces from the patch, merge it and I will retest when we merge it. Maybe the problem is that NetworkAccessManager _users_ are not freed upon exit... Like it looks like song provider list is not. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1141444
Andrey Karepin
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c20
--- Comment #20 from Dave Plater
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c21
--- Comment #21 from Dave Plater
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c22
--- Comment #22 from Manvendra Bhangui
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c23
--- Comment #23 from Dave Plater
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c24
--- Comment #24 from Dave Plater
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c25
--- Comment #25 from Manvendra Bhangui
My poor laptop struggles to play songs at all with visualizations.
There are two problems with the visualization. 1. Continous memory allocation 2. The rendering is done by the software (probably this will require a separate bug report). Your laptop will suffering because of this. Since the rendering is done by clementine, the cpu utilization of clementine hits the roof. In the original build around > 6 months back, the rendering was probably done by the driver. I'm pasting top output for FC30 build and the top output of the opensuse clementine build. In the FC30 build, when I turn on the visualization, it is 'X' that starts consuming a bit more CPU. In the opensuse build, the utilization of 'X' doesn't change at all, but CPU utilization of clementine shoots up. Top output of FC30 clementine with visualizer turned on ----------------------------------------------------------- top - 13:13:49 up 26 min, 2 users, load average: 0.72, 0.57, 0.46 Tasks: 315 total, 3 running, 311 sleeping, 0 stopped, 1 zombie %Cpu(s): 8.3 us, 1.1 sy, 0.0 ni, 90.4 id, 0.0 wa, 0.0 hi, 0.2 si, 0.0 st MiB Mem : 7921.395 total, 3520.688 free, 1511.516 used, 2889.191 buff/cache MiB Swap: 8195.996 total, 8195.996 free, 0.000 used. 6148.215 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2350 root 20 0 205000 69368 41884 S 30.56 0.855 1:05.96 X 8991 mbhangui 20 0 2661292 217756 130312 S 26.91 2.685 0:41.83 clementineO Top output of opensuse clementine with visualizer turned on ----------------------------------------------------------- top - 16:42:25 up 3:54, 5 users, load average: 0.81, 0.73, 0.67 Tasks: 318 total, 2 running, 315 sleeping, 0 stopped, 1 zombie %Cpu(s): 10.2 us, 2.0 sy, 0.0 ni, 77.7 id, 9.7 wa, 0.0 hi, 0.4 si, 0.0 st MiB Mem : 7921.395 total, 978.055 free, 5192.641 used, 1750.699 buff/cache MiB Swap: 8195.996 total, 8178.984 free, 17.012 used. 2360.668 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 11298 mbhangui 20 0 6344332 3.744g 123048 R 94.37 48.40 1:05.19 clementine 2350 root 20 0 229568 92216 44568 S 3.642 1.137 66:23.70 X -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c26
--- Comment #26 from Dave Plater
(In reply to Dave Plater from comment #24)
My poor laptop struggles to play songs at all with visualizations.
There are two problems with the visualization.
1. Continous memory allocation 2. The rendering is done by the software (probably this will require a separate bug report). Your laptop will suffering because of this. Since the rendering is done by clementine, the cpu utilization of clementine hits the roof. In the original build around > 6 months back, the rendering was probably done by the driver. I'm pasting top output for FC30 build and the top output of the opensuse clementine build. In the FC30 build, when I turn on the visualization, it is 'X' that starts consuming a bit more CPU. In the opensuse build, the utilization of 'X' doesn't change at all, but CPU utilization of clementine shoots up.
Top output of FC30 clementine with visualizer turned on ----------------------------------------------------------- top - 13:13:49 up 26 min, 2 users, load average: 0.72, 0.57, 0.46 Tasks: 315 total, 3 running, 311 sleeping, 0 stopped, 1 zombie %Cpu(s): 8.3 us, 1.1 sy, 0.0 ni, 90.4 id, 0.0 wa, 0.0 hi, 0.2 si, 0.0 st MiB Mem : 7921.395 total, 3520.688 free, 1511.516 used, 2889.191 buff/cache MiB Swap: 8195.996 total, 8195.996 free, 0.000 used. 6148.215 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2350 root 20 0 205000 69368 41884 S 30.56 0.855 1:05.96 X 8991 mbhangui 20 0 2661292 217756 130312 S 26.91 2.685 0:41.83 clementineO
Top output of opensuse clementine with visualizer turned on ----------------------------------------------------------- top - 16:42:25 up 3:54, 5 users, load average: 0.81, 0.73, 0.67 Tasks: 318 total, 2 running, 315 sleeping, 0 stopped, 1 zombie %Cpu(s): 10.2 us, 2.0 sy, 0.0 ni, 77.7 id, 9.7 wa, 0.0 hi, 0.4 si, 0.0 st MiB Mem : 7921.395 total, 978.055 free, 5192.641 used, 1750.699 buff/cache MiB Swap: 8195.996 total, 8178.984 free, 17.012 used. 2360.668 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 11298 mbhangui 20 0 6344332 3.744g 123048 R 94.37 48.40 1:05.19 clementine 2350 root 20 0 229568 92216 44568 S 3.642 1.137 66:23.70 X
If clementine 1.3.1 can do it then the qt5 branch should also. I think you should be patient with this bug, we are aware that visualizations are a memory hog. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c27
--- Comment #27 from Manvendra Bhangui
If clementine 1.3.1 can do it then the qt5 branch should also. I think you should be patient with this bug, we are aware that visualizations are a memory hog.
indeed. You guys are doing a good job. if there is a way I can help in testing and reduce the load on you guys, I will gladly do so. I know C (but not C++). I will give a try to clone the git repo and build clementine on my PC. I find strawberry a better player. I just wish strawberry had the visualizations and the ability to set ratings. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c28
--- Comment #28 from Jonas Kvinge
http://bugzilla.suse.com/show_bug.cgi?id=1141444
Swamp Workflow Management
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c31
--- Comment #31 from Swamp Workflow Management
http://bugzilla.suse.com/show_bug.cgi?id=1141444
Swamp Workflow Management
http://bugzilla.suse.com/show_bug.cgi?id=1141444
Robert Kaiser
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c32
--- Comment #32 from Swamp Workflow Management
http://bugzilla.suse.com/show_bug.cgi?id=1141444
Swamp Workflow Management
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c33
--- Comment #33 from Dave Plater
http://bugzilla.suse.com/show_bug.cgi?id=1141444
http://bugzilla.suse.com/show_bug.cgi?id=1141444#c34
Manvendra Bhangui
The patch delete_the_allocated_memory_in_respective_destructors.patch is now fully incorporated in clementine qt5 branch git #664c5a31f9cf519af5a4c3adcb30dbbc73d037d6 from 2019 October 04 Sent to Factory via sr#738088 Can I close this bug?
I can confirm that the issue is fixed for me -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com