Bug 467284 - plasmashell - Unbound memory leaks and high cpu usage on deactivation of secondary screen using xrandr
Summary: plasmashell - Unbound memory leaks and high cpu usage on deactivation of seco...
Status: RESOLVED DUPLICATE of bug 466362
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.27.2
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-13 15:42 UTC by fedy
Modified: 2023-03-24 18:35 UTC (History)
4 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 fedy 2023-03-13 15:42:14 UTC
SUMMARY
It looks like after update to plasma 5.27 the secondary screen activation / deactivation using xrandr on plasma/X11 stopped working correctly. Symptoms are:
- plasmashell cpu usage spikes to around 60% - reading from top (normally it keeps around 6% on my system) .
- it starts gradually leaking memory (got to around 5GB when I noticed it after few hours of use)
- reactivating the screen using xrandr again seems to fix the issue (at least the cpu use and memory leak)
- the reactivated screen has no background  - it's just black (worked fine on 5.26), It doesn't seem to be running plasmashell either (right click does nothing)

There is a workaround to deactivate the screen by un-checking the "Enable" from the "Configure display settings", but
 - not sure if it can be bound to a keyboard shortcut
 - doesn't remember the orientation of the disabled screen (screen is rotated 90° and needs to be configured again to activate)
 - plasma should probably try to play nice with standard X11 tools/utilities

POSSIBLY RELATED TO:
Bug 466362, Bug 465994

STEPS TO REPRODUCE
1. Start up plasma on X11 on a dual screen system
2. run top in terminal to observe plasmashell process
2. Deactivate secondary screen using something similar to:
    xrandr --output HDMI1 --auto --output HDMI2 --off
3. observe as the plasmashell process cpu usage spikes and the memory use starts growing rapidly
further (optional) steps:
4. reactivate second screen using something like:
    xrandr --output HDMI1 --auto --output HDMI2 --auto --rotate left --right-of HDMI1
5. observe that plasmashell cpu usage goes down and memory leaks (hopefully) stop
6. observe that reactivated screen is just black - no background, but cursor/windows are rendered ok.

ADDITIONAL NOTES:
 - if I disable the screen from "Configure display settings" (disabled by default) and just activate and deactivate it using the commands above, the cpu spike / memory leak doesn't seem to be there. I still get a black background and no plasma shell interactions on it (I.E. right click does nothing).

OBSERVED RESULT
 - memory leaks
 - cpu spikes
 - no background / plasmashell on reactivation

EXPECTED RESULT
 - none of the above

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 37
Linux/KDE Plasma: 5.27.2
KDE Plasma Version: 5.27.2 
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
Graphics Processor: Mesa Intel® UHD Graphics 605
Comment 1 Nate Graham 2023-03-13 22:40:16 UTC
Seems quite related to Bug 466362. Maybe even the same thing.
Comment 2 David Edmundson 2023-03-24 00:00:48 UTC

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