Bug 460370 - System Monitor leaks memory
Summary: System Monitor leaks memory
Status: RESOLVED FIXED
Alias: None
Product: plasma-systemmonitor
Classification: Applications
Component: general (show other bugs)
Version: 5.25.5
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
: 460561 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-10-13 14:36 UTC by Riccardo Robecchi
Modified: 2023-01-27 20:50 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27


Attachments
Screenshot (119.53 KB, image/png)
2022-10-13 14:36 UTC, Riccardo Robecchi
Details
Screenshot (48.45 KB, image/png)
2022-10-17 20:21 UTC, Onyx
Details
Current (57.00 KB, image/png)
2022-11-25 01:56 UTC, Onyx
Details
A little later (52.96 KB, image/png)
2022-11-25 06:01 UTC, Onyx
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Riccardo Robecchi 2022-10-13 14:36:16 UTC
Created attachment 152771 [details]
Screenshot

SUMMARY
If I keep System Monitor open for a while (indicatively more than one day, suspending the notebook for the night), it starts leaking memory. In the last 30 minutes it leaked ~50 MB. It can get to very high values, as you can see from the screenshot.

STEPS TO REPRODUCE
1. Open System Monitor.
2. Keep it open.

OBSERVED RESULT
Memory usage climbs up to very high levels.

EXPECTED RESULT
Memory usage stays constant.

SOFTWARE/OS VERSIONS
Linux: KDE neon
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2022-10-13 15:34:33 UTC
Thank you for the bug report!

Please note that Plasma 5.25.5 is not supported for much longer by KDE; supported versions are 5.24, and 5.26 or newer.

If at all possible please upgrade to a supported version and verify that the bug is still happening there.
Comment 2 Onyx 2022-10-17 20:21:28 UTC
Created attachment 152963 [details]
Screenshot

version 5.26.0
Comment 3 Riccardo Robecchi 2022-10-25 11:27:53 UTC
It started leaking again on 5.26.0 for me as well, after a few days in which it stayed at a very low memory footprint (< 100 MB). Since this affects at least another user, I am marking this as "confirmed".
Comment 4 Riccardo Robecchi 2022-11-24 12:06:03 UTC
*** Bug 460561 has been marked as a duplicate of this bug. ***
Comment 5 Arjen Hiemstra 2022-11-24 14:01:58 UTC
So this only happens when running it for a long time? Or does it always happen after resuming from suspend?
Comment 6 Onyx 2022-11-25 01:55:01 UTC
(In reply to Arjen Hiemstra from comment #5)
> So this only happens when running it for a long time? Or does it always
> happen after resuming from suspend?

Always after a long time for me.
Comment 7 Onyx 2022-11-25 01:56:03 UTC
Created attachment 154012 [details]
Current

Started at 137mb, gradual creep through the day.
Comment 8 Onyx 2022-11-25 06:01:02 UTC
Created attachment 154015 [details]
A little later

and still climbing, no suspend yet.
Comment 9 Arjen Hiemstra 2023-01-26 14:05:22 UTC
Git commit ebd169763aea87fa6203dc8f12ced639428525f4 by Arjen Hiemstra.
Committed on 26/01/2023 at 13:57.
Pushed by ahiemstra into branch 'master'.

table: Workaround a memory leak in QQmlPropertyCache

Apparently, the combination of a Connections object along with the
QAbstractItemModel::layoutChanged() signal leads to a memory leak inside
QQmlPropertyCache::createArgumentsObject(). To avoid that, put a proxy
signal in between that Connections can connect to.

The bug no longer exists in Qt 6 so this should be reverted after
switching to Qt 6.

M  +2    -0    src/faces/applicationstable/contents/ui/ApplicationsTableView.qml
M  +2    -0    src/faces/processtable/contents/ui/ProcessTableView.qml
M  +2    -2    src/table/BaseCellDelegate.qml
M  +14   -0    src/table/BaseTableView.qml

https://invent.kde.org/plasma/plasma-systemmonitor/commit/ebd169763aea87fa6203dc8f12ced639428525f4
Comment 10 Arjen Hiemstra 2023-01-26 14:16:07 UTC
Git commit d8dc56057758a50b23c4a23521fbf534daf61e28 by Arjen Hiemstra.
Committed on 26/01/2023 at 14:16.
Pushed by ahiemstra into branch 'Plasma/5.27'.

table: Workaround a memory leak in QQmlPropertyCache

Apparently, the combination of a Connections object along with the
QAbstractItemModel::layoutChanged() signal leads to a memory leak inside
QQmlPropertyCache::createArgumentsObject(). To avoid that, put a proxy
signal in between that Connections can connect to.

The bug no longer exists in Qt 6 so this should be reverted after
switching to Qt 6.


(cherry picked from commit ebd169763aea87fa6203dc8f12ced639428525f4)

M  +2    -0    src/faces/applicationstable/contents/ui/ApplicationsTableView.qml
M  +2    -0    src/faces/processtable/contents/ui/ProcessTableView.qml
M  +2    -2    src/table/BaseCellDelegate.qml
M  +14   -0    src/table/BaseTableView.qml

https://invent.kde.org/plasma/plasma-systemmonitor/commit/d8dc56057758a50b23c4a23521fbf534daf61e28