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

            Bug ID: 529132
           Summary: RDP session leaks memory
    Classification: Applications
           Product: krdc
      Version First 26.08.3
       Reported In:
          Platform: Garuda Linux
                OS: Linux
            Status: REPORTED
          Severity: major
          Priority: NOR
         Component: RDP
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 198672
  --> https://bugs.kde.org/attachment.cgi?id=198672&action=edit
krdc RDP memory growth measurements

It does not depend on the codec, and FreeRDP's own client does not show it.
Against the same server, through the same tunnel, on the same machine, krdc
grows with both H.264 and Progressive, while sdl-freerdp3 (same FreeRDP 3.33.1
libs) settles at ~0.8 GiB with both and stays there:

krdc 26.08.3, H.264 --> 142 GiB after 22 h, still growing (left it on overnight
with an app with procedural animations running on the server machine)
krdc 26.08.3, Progressive --> ~4.2 GiB after 20 min, still growing
sdl-freerdp3 3.33.1, H.264 --> ~0.8 GiB, flat after 4 min
sdl-freerdp3 3.33.1, Progressive --> ~0.8 GiB, flat after 3 min

(I forced Progressive on the server with KRDP_DISABLE_H264=1. "Force RemoteFX"
in krdc does not connect to KRdp, which I assume is expected since KRdp only
serves the graphics pipeline.)

STEPS TO REPRODUCE
1. Connect krdc to a KRdp server (KRdp 6.8.2 on Plasma, reached through an SSH
local forward ssh -N -L 3390:127.0.0.1:3389, krdc URL
rdp://user@localhost:3390. I used the following settings: resolution Large,
scale to window size on, acceleration Auto, color depth Auto, sound off,
clipboard sharing off)
2. Use the remote desktop normally, with content changing on screen,
3. Watch krdc's memory (watch -n 10 'grep -E "VmRSS|VmSwap" /proc/$(pgrep -x
krdc)/status'). In my case, it was jumping by ~0.1GB every ~10 seconds.

OBSERVED RESULT
Resident memory (and later swap) grows by roughly 100 MB per 10 s of screen
activity and never levels off. Over a long session it fills RAM and swap. In my
case, systemd-oomd does not intervene because the leaked pages are idle and
memory pressure stays low.

EXPECTED RESULT
Memory levels off after the session is established, as it does with
sdl-freerdp3


SOFTWARE/OS VERSIONS
Operating System: Garuda Linux (Arch-based), kernel 7.3.3-1-cachyos
KDE Plasma Version: 6.8.2
KDE Frameworks Version: 6.31.0
Qt Version: 6.12.0
Graphics Platform: Wayland

ADDITIONAL INFORMATION
krdc 26.08.3 (Arch package 26.08.3-1.1), FreeRDP 3.33.1 on the client. Server:
KRdp 6.8.2 with FreeRDP 3.32.2.
GPU: AMD Radeon RX 9070 XT, Mesa 26.2.6.

smaps_rollup of the leaking process showed Anonymous 36.3 GB and Swap 111.6 GB,
with only 2.8 MB file-backed and 42 MB shared. Full measurements are in the
attached text file. Since both codecs leak in krdc but not in sdl-freerdp3, my
theory is that the leak is probably in krdc code shared by both paths, maybe
around handing decoded frames to the view. I can try run heaptrack if that
would help.

I used AI to help me find the cause of the issue and guide me through the
process. I noticed the issue myself, have decent Linux knowledge and can
discuss and further help to pinpoint the exact cause as needed.

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

Reply via email to