Bug 392524 - Memory leak when connecting/disconnecting external display
Summary: Memory leak when connecting/disconnecting external display
Status: RESOLVED DUPLICATE of bug 368838
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.12.3
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-30 14:42 UTC by Alex Copot
Modified: 2018-04-09 16:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
plasmashell output (24.90 KB, text/x-log)
2018-03-30 16:50 UTC, Alex Copot
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Copot 2018-03-30 14:42:26 UTC
Each time I connect and disconnect the display, plasmashell increases memory usage by around 50MB and it never frees that. The biggest leak found by profiling with heaptrack is this (sorry for lack of symbols):

QImageData::create(QSize const&, QImage::Format) in ?? (libQt5Gui.so.5)
QImage::QImage(QSize const&, QImage::Format) in ?? (libQt5Gui.so.5)
<unresolved function> in ?? (libQt5Gui.so.5)
<unresolved function> in ?? (libQt5Gui.so.5)
QImageReader::read(QImage*) in ?? (libQt5Gui.so.5)
<unresolved function> in ?? (libQt5Quick.so.5)
<unresolved function> in ?? (libQt5Quick.so.5)
<unresolved function> in ?? (libQt5Quick.so.5)
<unresolved function> in ?? (libQt5Quick.so.5)
QApplicationPrivate::notify_helper(QObject*, QEvent*) in ?? (libQt5Widgets.so.5)
QApplication::notify(QObject*, QEvent*) in ?? (libQt5Widgets.so.5)
QCoreApplication::notifyInternal2(QObject*, QEvent*) in ?? (libQt5Core.so.5)
QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) in ?? (libQt5Core.so.5)
<unresolved function> in ?? (libQt5Core.so.5)
g_main_context_dispatch in ?? (libglib-2.0.so.0)
<unresolved function> in ?? (libglib-2.0.so.0)
g_main_context_iteration in ?? (libglib-2.0.so.0)
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) in ?? (libQt5Core.so.5)
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) in ?? (libQt5Core.so.5)
QThread::exec() in ?? (libQt5Core.so.5)
<unresolved function> in ?? (libQt5Quick.so.5)
<unresolved function> in ?? (libQt5Core.so.5)
start_thread in ?? (libpthread.so.0)
__GI___clone in ?? (libc.so.6)


I can easily reproduce it so I can try to do more debugging if you have any ideas. It's not clear to me if it's a problem in plasma or Qt.

Hardware:
- Thinkpad T470p with Gefore 940MX
- Samsung display connected by DisplayPort
Sofware:
- Archlinux
- plasma-workspace 5.12.3
- Qt 5.10.1-6
- mesa 17.3.7
- Xorg 1.19.6+13+gd0d1a694f-1
- glxinfo:
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel Open Source Technology Center (0x8086)
    Device: Mesa DRI Intel(R) HD Graphics 630 (Kaby Lake GT2)  (0x591b)
    Version: 17.3.7
    Accelerated: yes
    Video memory: 3072MB
    Unified memory: yes
Comment 1 Alex Copot 2018-03-30 15:05:13 UTC
Heaptrack recording: https://www.dropbox.com/s/y30r1agvcg7jymz/heaptrack.plasmashell.23177.zst?dl=0
Comment 2 David Edmundson 2018-03-30 16:37:09 UTC
please run 

kquitapp5 plasmashell
QSG_INFO=1 plasmashell

 and paste me the output
Comment 3 Alex Copot 2018-03-30 16:50:28 UTC
Created attachment 111735 [details]
plasmashell output

I uploaded the output and also did a display unplug/replug at the end.
Comment 4 David Edmundson 2018-04-09 16:21:48 UTC
thanks

*** This bug has been marked as a duplicate of bug 368838 ***