FS#61741 - [qt5-base] Abnormally huge memory usage by plasmashell

Attached to Project: Arch Linux
Opened by Lapin Roman (Lampus) - Wednesday, 13 February 2019, 07:13 GMT
Last edited by Antonio Rojas (arojas) - Sunday, 24 February 2019, 18:26 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Antonio Rojas (arojas)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 6
Private No

Details

Description:
After latest updates plasmashell uses more than 8 GiB of RAM (RSS).

% ps -eo pmem,comm,pid,maj_flt,min_flt,rss,vsz --sort -rss | head -n 2
%MEM COMMAND PID MAJFL MINFL RSS VSZ
53.0 plasmashell 23490 1 2145782 8701148 10049432

Valgrind output file in massif format in attachment.

Peak memory usage trace:
#-----------
snapshot=55
#-----------
time=10514349267
mem_heap_B=8785823950
mem_heap_extra_B=9383130
mem_stacks_B=0
heap_tree=detailed
n2: 8785823950 (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
n1: 8623439016 0x6520097: QImageData::create(QSize const&, QImage::Format) (in /usr/lib/libQt5Gui.so.5.12.1)
n2: 8623439016 0x65200EB: QImage::QImage(QSize const&, QImage::Format) (in /usr/lib/libQt5Gui.so.5.12.1)
n2: 8592471880 0x6520124: QImage::QImage(int, int, QImage::Format) (in /usr/lib/libQt5Gui.so.5.12.1)
n1: 8591856548 0x65633CC: QRasterPlatformPixmap::resize(int, int) (in /usr/lib/libQt5Gui.so.5.12.1)
n1: 8591856548 0x6562837: QPlatformPixmap::create(int, int, QPlatformPixmap::PixelType) (in /usr/lib/libQt5Gui.so.5.12.1)
n2: 8591856548 0x6559906: QPixmap::doInit(int, int, int) (in /usr/lib/libQt5Gui.so.5.12.1)
n2: 8591070780 0x4D4B198: ??? (in /usr/lib/libKF5Plasma.so.5.55.0)
n2: 8590365468 0x4D4C1F2: Plasma::Svg::image(QSize const&, QString const&) (in /usr/lib/libKF5Plasma.so.5.55.0)
n1: 8590311172 0x13FEDB3E: ??? (in /usr/lib/qt/qml/org/kde/plasma/core/libcorebindingsplugin.so)
n1: 8590311172 0x4FB1BCE: QQuickWindowPrivate::updateDirtyNode(QQuickItem*) (in /usr/lib/libQt5Quick.so.5.12.1)
n1: 8590311172 0x4FB2042: QQuickWindowPrivate::updateDirtyNodes() (in /usr/lib/libQt5Quick.so.5.12.1)
n2: 8590311172 0x4FB3575: QQuickWindowPrivate::syncSceneGraph() (in /usr/lib/libQt5Quick.so.5.12.1)
n1: 8589949160 0x4F58E77: ??? (in /usr/lib/libQt5Quick.so.5.12.1)
n1: 8589949160 0x4F5A24B: ??? (in /usr/lib/libQt5Quick.so.5.12.1)
n1: 8589949160 0x4F5DB56: ??? (in /usr/lib/libQt5Quick.so.5.12.1)
n1: 8589949160 0x6A3496A: ??? (in /usr/lib/libQt5Core.so.5.12.1)
n1: 8589949160 0x7CD6A9B: start_thread (in /usr/lib/libpthread-2.28.so)
n0: 8589949160 0x7130B21: clone (in /usr/lib/libc-2.28.so)
n0: 362012 in 1 place, below massif's threshold (1.00%)
n0: 54296 in 1 place, below massif's threshold (1.00%)
n0: 705312 in 2 places, all below massif's threshold (1.00%)
n0: 785768 in 4 places, all below massif's threshold (1.00%)
n0: 615332 in 6 places, all below massif's threshold (1.00%)
n0: 30967136 in 3 places, all below massif's threshold (1.00%)
n0: 162384934 in 3666 places, all below massif's threshold (1.00%)


Additional info:
* package versions:
- plasma-workspace 5.15.0-1
- plasma-framework 5.55.0-1
- qt5-base 5.12.1-2
- qt5-declarative 5.12.1-1
- nvidia-utils 415.27-1

Steps to reproduce:
- Just start a system with KDE/plasma desktop
This task depends upon

Closed by  Antonio Rojas (arojas)
Sunday, 24 February 2019, 18:26 GMT
Reason for closing:  Fixed
Additional comments about closing:  qt5-quickcontrols 5.12.1-2
Comment by Antonio Rojas (arojas) - Thursday, 14 February 2019, 09:14 GMT
Copying here all relevant info form  FS#61638 

Upstream report:
https://bugreports.qt.io/browse/QTBUG-73691

Bisected to
[9d90c0edac91b35ec96646fd3e6cdd339639ca79] QImage: merge the size calculations with proper (non-UB) checks

https://github.com/qt/qtbase/commit/9d90c0edac91b35ec96646fd3e6cdd339639ca79

Workaround: use the breeze Plasma theme
Comment by Benjamin Robin (benjarobin) - Tuesday, 19 February 2019, 20:26 GMT
I can confirm that reverting 9d90c0eda does fix this issue, running with nvidia proprietary driver

I did add a lot of debug information in the Qt bug report https://bugreports.qt.io/browse/QTBUG-73691
And since the bug is apparently in the Oxygen theme, I also reported the information here: https://bugs.kde.org/show_bug.cgi?id=403978
Comment by Benjamin Robin (benjarobin) - Sunday, 24 February 2019, 09:49 GMT
Qt bug report website is down for now, but I think I found the proper fix for this bug.
It looks like the bug is inside qt5-quickcontrols package in the following file: /usr/lib/qt/qml/QtQuick/Controls/Styles/Base/ScrollViewStyle.qml
Comment by Antonio Rojas (arojas) - Sunday, 24 February 2019, 17:24 GMT
Thanks for the patch, please confirm it's fixed in qt5-quickcontrols 5.12.1-2
Comment by Benjamin Robin (benjarobin) - Sunday, 24 February 2019, 18:25 GMT
Fixed for me, thanks

Loading...