Bug 444323 - Memory usage is not shown for processes owned by other users
Summary: Memory usage is not shown for processes owned by other users
Status: CONFIRMED
Alias: None
Product: ksystemstats
Classification: Frameworks and Libraries
Component: General (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
: 464191 468947 486470 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-10-24 13:17 UTC by Prajna Sariputra
Modified: 2024-06-27 07:23 UTC (History)
9 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Prajna Sariputra 2021-10-24 13:17:53 UTC
SUMMARY
Memory/RAM usage is not shown for processes owned by other users, so if one of those processes (like system services running under root or another user) ends up gobbling up memory the System Monitor would not be helpful for finding out which process is causing it.

STEPS TO REPRODUCE
1. Open the Processes page
2. Make it show System Processes

OBSERVED RESULT
At least some of the processes should have a value for the memory usage (excluding things like kworkers of course).

EXPECTED RESULT
The Memory column is completely empty.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.23.1
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Kernel Version: 5.14.13-arch1-1 (64-bit)

ADDITIONAL INFORMATION
KSysGuard does show the memory usage for some root processes (like packagekitd for example), and so does the GNOME System Monitor for that matter.
Comment 1 Nate Graham 2021-10-25 21:13:27 UTC
Can reproduce.
Comment 2 Prajna Sariputra 2021-10-30 07:40:39 UTC
Oh, and it appears that it's not just processes owned by other users, a few owned by my user (like kwin_wayland and org_kde_powerdevil) are affected too, not sure if it's exactly the same issue though.

Again KSysGuard shows their memory usage just fine, and I'm using the systemd startup for what it's worth.
Comment 3 Nate Graham 2023-01-12 19:59:50 UTC
*** Bug 464191 has been marked as a duplicate of this bug. ***
Comment 4 Arjen Hiemstra 2023-01-18 12:06:12 UTC
So the "memory" column shows the so called "VmPSS" value that is retrieved from `/proc/$pid/smaps_rollup`. Unfortunately this file is not world-readable but only user-readable unlike some of the other files in /proc. This means that when we try to read that file for non-user owned processes, we get an access denied and cannot read that value. Additionally, some processes set a flag that tells the kernel to disallow reading that file, which ends up with the same result.

Overall, I'm not really happy with how that value is exposed by the kernel, yet it is the best matching value for actual memory we can get, as it includes both the private memory usage as well as the process' share of the shared memory. So by default we use that column. The column called "Memory" in KSysGuard actually still exists but has been renamed to "Private Memory Usage" as that is what it actually is. That column reads from a file that *is* world readable so if you enable that, you get memory information for other processes as well.
Comment 5 Arjen Hiemstra 2024-02-19 14:49:24 UTC
*** Bug 468947 has been marked as a duplicate of this bug. ***
Comment 6 popov895 2024-05-17 09:26:40 UTC
*** Bug 486470 has been marked as a duplicate of this bug. ***