Created attachment 184915 [details] x86-64 Linux ELF executable that demonstrates the issue. It opens an empty X11 window and waits for the close button. Steps to reproduce: - do NOT follow these steps if you never heard my name - never start an untrusted executable you downloaded from the internet - start the attached executable using the X11 session; an X11 window should appear - use Ctrl+Esc to show the "System Activity" window - make sure the "Memory" column is enabled - read the value in the "Memory" column for the started "x11minimal" executable Expected result: - shows "0 K" or more Memory usage Actual result: - shows "-4 K" Memory usage Version information: - Plasma master from yesterday - openSUSE Tumbleweed from yesterday
Hmm, when I try this, it says "15 KiB" for the memory usage. I'm on Wayland though, using KDE Linux. Do you have to be on X11 to reproduce the issue?
So the memory calculations were changed a while back, so now what we do is read a "rough" value from `/proc/$PID/statm` and a "precise" value from `/proc/$PID/smaps_rollup`, with the latter updating on a much more reduced frequency (as its a CPU intensive operation to read that file). We then calculate the difference between precise and rough value and when we read a new value from `statm` we add the previously calculated difference to get at a more "precise" value. I assumed these numbers would always result in a positive number, but apparently you found a corner case where that's incorrect. Ensuring it's at least 0 should be fairly trivial.
.... except it already does that: https://invent.kde.org/plasma/libksysguard/-/blob/master/processcore/memoryinfo_p.h?ref_type=heads#L116 So there's more to this bug report than just that. Can you give me the output of `/proc/$PID/smaps_rollup` and `/proc/$PID/status` (with PID being the PID of x11minimal) when this happens? I can't reproduce myself.
Created attachment 185248 [details] Output of /proc/PID/status
If it helps, here is the /proc/maps output: 00400000-00401000 r-xp 00000000 103:07 661979 /PATH/x11minimal 7f4c4a5b3000-7f4c4a5b7000 r--p 00000000 00:00 0 [vvar] 7f4c4a5b7000-7f4c4a5b9000 r-xp 00000000 00:00 0 [vdso] 7ffd81469000-7ffd8148b000 rw-p 00000000 00:00 0 [stack] ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0 [vsyscall] libksysguard6 at eef71de
Created attachment 185253 [details] Output of /proc/PID/smaps_rollup
Hmm, and `/proc/PID/statm`? Both of the other files look like what I also get here, so this is getting increasingly confusing. Maybe you can also show a screenshot with Proportional/Resident/Shared/Private memory usage columns active?
I don't have all memory columns you mentioned, so I assume those come from the newer (QtQuick based) system monitor. I'm using ksysguard6, which is not maintained upstream.