https://bugs.kde.org/show_bug.cgi?id=368838

Matt Whitlock <k...@mattwhitlock.name> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |k...@mattwhitlock.name

--- Comment #31 from Matt Whitlock <k...@mattwhitlock.name> ---
I am experiencing this bug on a single monitor with the AMDGPU driver, Qt
5.9.3, and Plasma 5.11.4, running on Linux 4.14.13-gentoo. This bug has been
affecting me for a few months now, plausibly since I upgraded to the Qt 5.9.x
series from 5.7.1 at the end of September 2017.

I have the slideshow wallpaper set to change every 29 minutes and 1 second, and
I can get 1-2 weeks of use out of my desktop session until I run out of
available memory and my system starts thrashing and I have to take steps (see
below) to recover and continue. Memory usage seems to grow even while I am away
from my computer (i.e., while it's sitting at the KDE Screen Locker with the
monitor powered down).

Of particular interest on my system: the majority of the memory usage isn't
attributed to the plasmashell process, as reported by 'ps' and 'top'.
Bizarrely, the memory usage appears to be accountable to *no process*. Because
of this, it took me a long time to track it down to Plasma. I even reported a
kernel bug[1], as the memory seemed to be inexplicably in use by the kernel
itself: adding up the memory counters in /proc/*/status across all running
processes yields a total memory usage that does not account for the complete
exhaustion of MemAvailable in /proc/meminfo.

How I know plasmashell is the culprit:

1. My system started to become sluggish, which happens as the kernel starts
evicting pages of executable code from RAM and having to load them back in from
disk. (If not immediately addressed, this condition worsens until I have no
choice but to invoke the OOM killer using Magic SysRq to reclaim a little bit
of memory so I can proceed with the next steps.)
2. I switched to a text-mode VT and ran 'echo 2 > /proc/sys/vm/drop_caches' as
root. This elicited a short pause before the prompt reappeared, and then 'free'
reported a small amount of additional available memory.
3. I killed (by SIGTERM) my plasmashell process. Some memory was immediately
freed (as expected), but about 3 GB was still unaccounted for. That is, 'free'
reported much more memory as "used" than the sum of all processes in my system.
4. I ran 'echo 2 > /proc/sys/vm/drop_caches' again. This time the prompt took
noticeably longer to reappear.
5. Now 'free' reported a sane number for "used", which was fully attributable
to the set of remaining processes running on my system.

My usual procedure for recovering from the low-memory scenario is to log out of
my KDE session entirely and then do the drop_caches trick to get the kernel to
release the apparently unaccounted-for memory. But this time I left my session
running and only killed plasmashell. That was enough to unstick the memory, and
that's how I found my way to this bug report.

I am a low-level C/C++ developer, but I have very little experience with OpenGL
and no experience with Qt. My current (only somewhat informed) working theory
is that the plasmashell process is allocating wallpapers in video memory but
never freeing them and that this memory is not accounted to the process in the
usual ways, as it is nominally not system RAM. However, because VRAM is
limited, eventually the kernel shifts the disused wallpapers out of VRAM and
into system RAM, where they sit, not accounted to any process. I do not
understand why killing the plasmashell process does not immediately cause the
kernel to free this memory, though. I have to tell the kernel to drop its
inode+dentry caches to get the memory back.

As I only get into this situation every week or two and have to address the
situation immediately when it occurs, it's hard for me to try things and report
back quickly, but I would gladly welcome any suggestions and will supply any
information requested. Since I run Gentoo, I am able to patch sources and
rebuild packages easily.

At the moment, I am going to try disabling the slideshow wallpaper and see if
plasmashell no longer causes this unaccountable memory usage. I will report
back in a few weeks with my findings.

__________

[1] https://bugzilla.kernel.org/show_bug.cgi?id=197783 - Incidentally, the
rogue memory pages are swappable.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to