Bug 396651 - Dolphin memory leak
Summary: Dolphin memory leak
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 17.12.3
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-18 22:12 UTC by aditsu
Modified: 2018-07-26 01:27 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aditsu 2018-07-18 22:12:58 UTC
I recently noticed that some dolphin processes started eating a lot of ram (~1GB each). I ran dolphin in valgrind --leak-check=full and it started at about 300MB, then after 2 days I found that it ate 2GB more. I closed it and got a 1.4MB log file.

This is the end of the log:

==29963== 16,560 (72 direct, 16,488 indirect) bytes in 1 blocks are definitely lost in loss record 1,019 of 1,023
==29963==    at 0x4C2D57F: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==29963==    by 0xAF10C02: ??? (in /usr/lib64/libQt5Core.so.5.9.4)
==29963==    by 0xAF12E41: QObject::connect(QObject const*, char const*, QObject const*, char const*, Qt::ConnectionType) (in /usr/lib64/libQt5Core.so.5.9.4)
==29963==    by 0x6F79A51: KIO::TransferJobPrivate::start(KIO::Slave*) (in /usr/lib64/libKF5KIOCore.so.5.46.0)
==29963==    by 0x6F84583: KIO::ProtoQueue::startAJob() (in /usr/lib64/libKF5KIOCore.so.5.46.0)
==29963==    by 0xAF0C838: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib64/libQt5Core.so.5.9.4)
==29963==    by 0xAF18F06: QTimer::timeout(QTimer::QPrivateSignal) (in /usr/lib64/libQt5Core.so.5.9.4)
==29963==    by 0xAF19217: QTimer::timerEvent(QTimerEvent*) (in /usr/lib64/libQt5Core.so.5.9.4)
==29963==    by 0xAF0D7AA: QObject::event(QEvent*) (in /usr/lib64/libQt5Core.so.5.9.4)
==29963==    by 0x9C7AD6B: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib64/libQt5Widgets.so.5.9.4)
==29963==    by 0x9C825F8: QApplication::notify(QObject*, QEvent*) (in /usr/lib64/libQt5Widgets.so.5.9.4)
==29963==    by 0xAEE3C99: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib64/libQt5Core.so.5.9.4)
==29963== 
==29963== LEAK SUMMARY:
==29963==    definitely lost: 3,038 bytes in 73 blocks
==29963==    indirectly lost: 27,742 bytes in 292 blocks
==29963==      possibly lost: 12,321 bytes in 184 blocks
==29963==    still reachable: 4,614,613 bytes in 4,261 blocks
==29963==                       of which reachable via heuristic:
==29963==                         newarray           : 4,264 bytes in 1 blocks
==29963==         suppressed: 0 bytes in 0 blocks
==29963== Reachable blocks (those to which a pointer was found) are not shown.
==29963== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==29963== 
==29963== For counts of detected and suppressed errors, rerun with: -v
==29963== ERROR SUMMARY: 179 errors from 179 contexts (suppressed: 1 from 1)
dolphin.log lines 18160-18186/18186 (END)
Comment 1 aditsu 2018-07-20 16:01:13 UTC
In the meantime I ran it again with --show-leak-kinds=all, the memory usage grew by about 1.3GB in 1.5 days; after closing it I got a 33MB log file that ends in:

==19355== 2,097,152 bytes in 1 blocks are still reachable in loss record 1,056 of 1,056
==19355==    at 0x4C2CF0F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==19355==    by 0xAD42A9C: QArrayData::allocate(unsigned long, unsigned long, unsigned long, QFlags<QArrayData::AllocationOption>) (in /usr/lib64/libQt5Core.so.5.9.4)
==19355==    by 0xAEEB676: ??? (in /usr/lib64/libQt5Core.so.5.9.4)
==19355==    by 0xAEEB8DF: ??? (in /usr/lib64/libQt5Core.so.5.9.4)
==19355==    by 0xAEE6265: QCoreApplication::postEvent(QObject*, QEvent*, int) (in /usr/lib64/libQt5Core.so.5.9.4)
==19355==    by 0x1E6FEC30: ??? (in /usr/lib64/qt5/plugins/styles/breeze.so)
==19355==    by 0x1E6FECC8: ??? (in /usr/lib64/qt5/plugins/styles/breeze.so)
==19355==    by 0x1E6FA683: ??? (in /usr/lib64/qt5/plugins/styles/breeze.so)
==19355==    by 0xAF0C838: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib64/libQt5Core.so.5.9.4)
==19355==    by 0xAF0D1EE: QObject::destroyed(QObject*) (in /usr/lib64/libQt5Core.so.5.9.4)
==19355==    by 0x9CB5C38: QWidget::~QWidget() (in /usr/lib64/libQt5Widgets.so.5.9.4)
==19355==    by 0x9DFAAE8: QMenu::~QMenu() (in /usr/lib64/libQt5Widgets.so.5.9.4)
==19355== 
==19355== LEAK SUMMARY:
==19355==    definitely lost: 2,310 bytes in 44 blocks
==19355==    indirectly lost: 53,983 bytes in 589 blocks
==19355==      possibly lost: 12,321 bytes in 184 blocks
==19355==    still reachable: 2,498,560 bytes in 4,263 blocks
==19355==                       of which reachable via heuristic:
==19355==                         newarray           : 4,264 bytes in 1 blocks
==19355==         suppressed: 0 bytes in 0 blocks
==19355== 
==19355== For counts of detected and suppressed errors, rerun with: -v
==19355== ERROR SUMMARY: 177 errors from 177 contexts (suppressed: 0 from 0)
Comment 2 Nate Graham 2018-07-20 19:21:20 UTC
See https://phabricator.kde.org/D14253
Comment 3 Jaime Torres 2018-07-21 11:44:51 UTC
Git commit 021daba60fafdf304b1079a705de900c431bb579 by Jaime Torres.
Committed on 21/07/2018 at 11:44.
Pushed by jtamate into branch 'master'.

avoid memory leak in slave jobs

Summary:
Making ~SlaveInterface virtual, the connection created in Slave constructor is now deleted. (thanks @dfaure).
Changed to new connect syntax.

Test Plan:
The leaks of the bug report are gone.

Reviewers: dfaure, #frameworks, ngraham

Reviewed By: dfaure

Subscribers: anthonyfieroni, apol, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D14253

M  +2    -2    src/core/slave.cpp
M  +1    -1    src/core/slaveinterface_p.h

https://commits.kde.org/kio/021daba60fafdf304b1079a705de900c431bb579