Bug 465994 - Memory consumption keeps increasing when a screen switched off by nvidia-settings
Summary: Memory consumption keeps increasing when a screen switched off by nvidia-sett...
Status: RESOLVED DUPLICATE of bug 466362
Alias: None
Product: KScreen
Classification: Plasma
Component: common (show other bugs)
Version: 5.27.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: 1.0
Assignee: kscreen-bugs-null@kde.org
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2023-02-18 12:00 UTC by NSLW
Modified: 2023-03-03 09:39 UTC (History)
2 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 NSLW 2023-02-18 12:00:16 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
My setup is a laptop with an external monitor connected through a HDMI cable. If I set my laptop screen to off in nvidia-settings then plasmashell memory consumption starts increasing with no limit. 

This used to work in Plasma version 5.26, but stopped in 5.27. Interestingly, setting my laptop screen to off in "kcmshell5 kcm_kscreen" instead switches my laptop screen off but doesn't cause the memory consumption increase.


STEPS TO REPRODUCE
1. Do a fresh start of Plasma
2. Start nvidia-settings
3. Go to "X Server Display Configuration"
4. Choose your laptop screen under "Selection:"
5. Choose "Off" under "Resolution:"
6. Uncheck "Make this the primary display for the X screen"
7. Press "Apply" button

OBSERVED RESULT
Memory consumption of plasmashell keeps gradually increasing from around 200 MB to my memory limits.

EXPECTED RESULT
Memory consumption of plasmashell should not start increasing.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.27.0
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
1. My GPU driver is nvidia-340xx
2. X11 session
3. Screens are initially set to cloning
Comment 1 Nate Graham 2023-02-23 00:16:47 UTC
It's not recommended to use NVIDIA tools to manage screens for many reasons, and this is one of them. :)
Comment 2 NSLW 2023-02-23 15:51:46 UTC
I think it's fixable. Memory consumption stops increasing as soon as the laptop screen is turned on again in nvidia-settings (although what has been consumed already isn't returned :) ) Memory consumption resumes increasing as soon as the laptop screen is turned off. That means that I can switch increased memory consumption on and off.

There are some screen settings that can be set through nvidia-settings and not through KDE settings.

By saying "it's not recommended" do you mean it's not be meant to be fixed to work as before?
Comment 3 Nate Graham 2023-02-23 23:14:40 UTC
KScreen watches for external changes, such as those done by nvidia-settings. Likely what's happening is that somehow the changes being done by nvidia-settings are triggering a condition in kscreen that never stops doing something.
Comment 4 NSLW 2023-02-24 15:48:20 UTC
Ok, it seems so. Memory increases happen at a rate of 1 MB per read out by old KDE System Monitor. I'm not sure how to debug it. Can I help somehow to debug it further?
Comment 5 Nate Graham 2023-02-24 17:53:25 UTC
If you disable the "KScreen 2" service in the System Settings "Background Services" page and reboot, does the issue stop happening?

(remember to turn it back on after testing!)
Comment 6 NSLW 2023-02-25 07:11:47 UTC
When:
1) laptop screen: disabled at startup, monitor screen: enabled at startup, kscreen2: enabled at startup
No increases in memory consumption observed when enabling and disabling my screens in different configurations through nvidia-settings.
I don't know on what my system depends to keep the setting to disable my laptop screen at startup but when it does so I'm happy.
I want to add that at the login screen both screens are enabled and after login my laptop screen gets disabled by itself. It's ok for me.

2) laptop screen: enabled at startup, monitor screen: enabled at startup, kscreen2: disabled at startup
No increases in memory consumption observed when enabling and disabling my screens in different configurations through nvidia-settings.

3) laptop screen: enabled at startup, monitor screen: enabled at startup, kscreen2: enabled at startup
Increases in memory consumption observed when disabling my laptop screen through nvidia-settings (as reported initially).
Comment 7 David Edmundson 2023-03-03 09:39:31 UTC

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