Bug 492440

Summary: Setting cap_sys_nice on KWin prevents System Monitor app and widgets from being able to query its memory usage
Product: [Frameworks and Libraries] ksystemstats Reporter: Nate Graham <nate>
Component: GeneralAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: ahiemstra, vlad.zahorodnii, xaver.hugl
Priority: NOR Keywords: regression
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.2.0
Sentry Crash Report:

Description Nate Graham 2024-08-31 05:03:09 UTC
KWin sets this when built from source and recommends that distros set it too; see https://community.kde.org/Distributions/Packaging_Recommendations#KWin_package_configuration.

However this prevents ksystemstats from querying its memory usage; open the app, go to the processes page and search for "kwin", and you'll see that it has its CPU usage reported, but not memory.

This is a somewhat significant omission as KWin is a core system component especially in a Wayland session, so being able to monitor its memory usage is important.

`top` is able to gather memory usage statistics for KWin in this state, so ksystemstats ought to be able to do so as well.
Comment 1 Nate Graham 2024-10-02 14:18:44 UTC
cap_sys_nice appears to have been a red herring, and this was caused by https://invent.kde.org/plasma/libksysguard/-/commit/1f48d7e9c420a40372b7ecfaf20d99d2e876168c. It's fixed in 6.2.0 by Arjen Hiemstra with https://invent.kde.org/plasma/libksysguard/-/commit/f23b43c56df616ec8ca582676050cdf69b0727cd