[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1037268: kwin-x11: resource leak: the number of threads increases over time, boundlessly



Control: tag -1 confirmed

Julien Muchembled <jm@jmuchemb.eu> writes:

> After 17 days, the number of threads of /usr/bin/kwin_x11 process has
> exceeded 2700 and it keeps increasing. At the beginning
> of a session, the process starts with 34 threads.

Interesting!  Mine starts with only 11 threads.  I wonder if this is
hardware dependent?

> I could find that such leak happens when viewing videos fullscreen e.g. with mpv. Can anyone reproduce it ? More precisely:
> 1. start mpv without --fs -> thread count does not change
> 2. switch to fullscreen -> usually -2 threads
> 3. leaves fullscreen -> usually +17 threads
> 4. exit mpv -> thread count does not change

I was able to reproduce (with mpv 0.35.1-4), but going fullscreen didn't
increase the kwin thread count on my system; however, exiting fullscreen
consistently increased kwin's thread count by exactly two threads each
time mpv leaves fullscreen.  I would say "I'm horrified too!" but
couldn't this be a new feature that is designed to limit media
consumption? ;)

> Such a leak is at least a severe issue for anyone like me who set a nproc limit to protect against fork-bombs, in particular because it causes mysterious process crashes. I only understood the problem when I wanted to build a software that spawned a lot of processes. It also makes nproc limiting quite unusable without restarting KDE from time to time.

The good news is that one doesn't need to restart KDE.  Try this:

  kwin --replace&

> Version 4:5.27.2-2 was affected too. I previously had 4:5.24.4-1 and I'm almost sure it had no leak.

That's not a terrible range to bisect, if it comes to that.

> A few notes that may be specific to my setup:
> - I do have a 4k intel display. And regularly, for less than 1s, the
> display is corrupted. I haven't tried Wayland yet and I hope it will
> fix it.

Oh, maybe this is why yours has more threads than mine?  Maybe it's
resolution dependent?  (I'm not familiar with kwin's source)

> - I use mpv from deb-multimedia.

For reference, please note that bugs must be reproducible with Debian
alone, otherwise they may be marked invalid.

> - mpv conf: vo = gpu

Here is the config I confirmed with:

  hwdec=vaapi
  vo=gpu
  profile=gpu-hq

> I couldn't find anything on bug.kde.org: should I forward ?

Yes please :)

Kind regards,
Nicholas

Attachment: signature.asc
Description: PGP signature


Reply to: