Bug 394436

Summary: Serious memory leak when realigning folderview widget icons.
Product: [Plasma] plasmashell Reporter: Antonio Orefice <kokoko3k>
Component: FolderAssignee: Eike Hein <hein>
Status: RESOLVED FIXED    
Severity: normal CC: kde, nate, plasma-bugs
Priority: NOR    
Version: 5.12.5   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Antonio Orefice 2018-05-19 08:54:46 UTC
Have a folderview  installed on the desktop, the following will exhaust all of my  system memory very quickly.
Nothing special, it just pick any folderview you have on the desktop, realign the icons, and moves them back, you won't see anything moving on the desktop, it is too fast, i guess, but still,my memory usage grows indefinitely.

Be careful!


#!/bin/bash
while true ; do
  qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript "$(cat ./folderview.re-align.js)"
  date
  grep VmRSS < /proc/`pidof plasmashell`/status | awk '{print $2}'
done

...where ./folderview.re-align.js is the following:
 for (i=0;i<activityIds.length;i++) {{
     desktop=desktopById(activityIds[i])
     print ("Attività " +i)
     for (Wid=0;Wid<desktop.widgetIds.length;Wid++) {{
         WidgetID=desktop.widgetIds[Wid]
         MyWidget=desktop.widgetById(WidgetID)
         if ( MyWidget.type == "org.kde.plasma.folder") {
             old=MyWidget.readConfig("alignment",0)
             if (old == 0) {
                MyWidget.writeConfig("alignment",1)
                MyWidget.reloadConfig()
                } else {
                MyWidget.writeConfig("alignment",0)
                MyWidget.reloadConfig()
             }
             MyWidget.writeConfig("alignment",old)
             MyWidget.reloadConfig()
         }
         
     }}
}}


My output:
koko@slimer# ./run.sh 
Sat May 19 10:51:43 CEST 2018
331440
Sat May 19 10:51:44 CEST 2018
348576
Sat May 19 10:51:44 CEST 2018
350652
Sat May 19 10:51:45 CEST 2018
346244
Sat May 19 10:51:46 CEST 2018
350256
[..]
Sat May 19 10:54:09 CEST 2018
923880
Sat May 19 10:54:10 CEST 2018
926256
^C
Comment 1 Antonio Orefice 2018-05-28 07:18:14 UTC
I tested on another system with qt 5.11 and this seems to be fixed.
Marking as solved.