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

--- Comment #29 from Ash Blake <telepath...@tutanota.com> ---
Created attachment 141874
  --> https://bugs.kde.org/attachment.cgi?id=141874&action=edit
A C program that reproduces the bug

I figured out which behaviour of the Jetbrains IDEs causes the bug to occur and
I wrote a program that replicates it, so the bug can be reproduced reliably and
without the need to install any software.

This program will repeatedly create a specified amount of windows, waiting some
time before destroying the current window and creating the next one. After
that, it will wait a specified amount of time and repeat the whole thing.

The amount of windows and the time constants are optional program arguments.
The default settings are supposed to replicate a realistic scenario that could
happen during the IDE usage. They are as follows:
  - (arg1) burst size: 2
  - (arg2) window lifetime (ms): 16
  - (arg3) post-burst wait time (ms): 3000
The short burst length of 2 was motivated by observing the popup windows
flicker without any content sometimes, before the actual popup appeared.

On my machine, this burst size and window lifetime causes the KWin's file
descriptor count to increase by 3 each repetition, same as when a popup is
opened normally in a Jetbrains IDE. Of course, if such settings do not cause
bug reproduction in your environment, start by increasing the burst size. If
the bug still isn't reproduced with a high amount of created windows, start
decreasing the window lifetime.

Some observations: 
1. If the window lifetime is large enough to reliably observe the window's icon
appearing on the taskbar, this bug does not occur. On my machine, a window
lifetime of 60ms is the minimum one that does not cause KWin's file descriptor
amount to notably rise at any point in time, even with a burst size of 99999
windows.
2. Window lifetimes less or equal to 4ms will cause KWin to lag, up to the
point of a complete freeze (which resolves during the wait time). Of course
this is a terribly unrealistic scenario and no application would ever do that,
but watch out when testing.


Compilation:
$ gcc reproduce_438097.c -lX11 -o reproduce_438097

Usage
$ ./reproduce_438097 [burst size] [window lifetime] [post-burst wait time]

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

Reply via email to