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

            Bug ID: 480798
           Summary: KDE / KWin slowly eats (leaks?) my graphics memory
                    (GART) until it begins stuttering
    Classification: Plasma
           Product: kwin
           Version: 5.93.0
          Platform: Arch Linux
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: wayland-generic
          Assignee: kwin-bugs-n...@kde.org
          Reporter: adam.m.fontenot+...@gmail.com
  Target Milestone: ---

SUMMARY
My integrated AMD GPU has a substantial amount of memory assigned to GART [1].
In fact, about half my system memory is available for GART. 

Over about a week of using KDE under Wayland, I see the GART memory use slowly
climb. It fluctuates on a minute to minute basis, e.g. if I close Firefox right
now I'll probably reclaim 300-500 MB of GART. Since the GART overlaps with
system memory my available system memory will also increase by this amount (in
addition to reclaimed pages from closing Firefox).

However, this savings from closing an application is temporary. With KDE under
Wayland, usage slowly but inevitably climbs until it is full (reaches the
maximum allocation the kernel will give it). When this happens, graphics heavy
effects like the Overview effect will become slow and laggy. It will feel like
KDE is slow, or that something is taxing the CPU, or that the system memory is
low, but this isn't the case.

Even after killing every application on my desktop (even restarting
plasmashell), this memory is not reclaimed. We're talking at least 16 GB of
memory on my system that can't be used until I end the KDE graphical session.
On top of the visible problems (like stuttering) this induces, it can also be a
problem for memory availability.

STEPS TO REPRODUCE
1. Have an integrated AMDGPU (?)
2. Use KDE for a while (about a week?) without shutting down or closing your
session. (Putting the system to sleep is fine.)

Some notes on usage:

 * I have multiple monitors and switch between them regularly.
 * I occasionally use graphics heavy programs, e.g. video games (and even
Firefox can be relatively heavy). These games are still being composited by the
KWin compositor for Wayland, which seems like a possible source of this
problem.

OBSERVED RESULT

The memory claimed by GART (check `radeontop` for this, where it is reported as
"GTT") slowly climbs until all available resources are consumed.

I've noticed that doing anything graphics heavy seems to make the problem worse
(even after closing the program), although it's extremely difficult to quantify
this since there's plenty of temporary fluctuation.

EXPECTED RESULT

With no programs running (except the KDE desktop) the memory claimed by
graphics should be very low. I would naively say that no more than 1 GB is
reasonable, but in any case the usage I'm seeing exceeds that by far.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.93.0
KDE Frameworks Version: 5.249.0
Qt Version: 6.7.0
Kernel Version: 6.7.3-arch1-1 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION

I'm going to switch to the X11 session for a few days to see if I can replicate
the issue there. If I can, I'll try switching to something else (e.g. Gnome?)
for the same amount of time, to hopefully verify that this is not a weird issue
with my graphics drivers. I don't think it is - ending the KDE session and
returning to the getty login clears *all* the claimed memory immediately.

[1] https://en.wikipedia.org/wiki/Graphics_address_remapping_table

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

Reply via email to