Created attachment 177289 [details] Video showing the memory leak issue. SUMMARY Memory leak in Spectacle when recording the screen on KDE Neon Unstable Edition. STEPS TO REPRODUCE 1. Open Spectacle. 2. Start screen recording. 3. Wait for the memory usage to increase over time. OBSERVED RESULT Memory usage increases significantly, leading to high memory consumption and potential crashes over time. EXPECTED RESULT Screen recording should not cause memory leaks, and memory usage should remain stable throughout the process. SOFTWARE/OS VERSIONS Operating System: KDE neon Unstable Edition KDE Plasma Version: 6.3.80 KDE Frameworks Version: 6.11.0 Qt Version: 6.8.1 Kernel Version: 6.8.0-51-generic (64-bit) Graphics Platform: Wayland Processors: 4 × Intel® Xeon® CPU E3-1220 V2 @ 3.10GHz Memory: 15.6 ГиБ of RAM Graphics Processor: AMD Radeon RX 570 Series ADDITIONAL INFORMATION Screenshot authorization issue: - When launching via Valgrind, the error `The process is not authorized to take a screenshot` occurs. - Unable to perform memory leak analysis due to the inability to take a screenshot. Original error message: Ошибка запроса создания снимка экрана KWin: The process is not authorized to take a screenshot Сведения, которые, возможно, будут полезны: Method: CaptureScreen Method-specific arguments: "DVI-D-1"
I was able to analyze a memory leak in the Spectacle application using Heaptrack. The tool revealed a significant number of memory leaks and identified problematic areas in memory usage. heaptrack stats: allocations: 977621 leaked allocations: 164050 temporary allocations: 243418
Created attachment 177290 [details] The attached file is the Heaptrack report containing information about memory allocations and leaks.
According to the reporter's attached heaptrack report, the problem seems to come from KPipeWire's PipeWireSourceStream class.
I can reproduce on Fedora KDE 41 - differently, based on what exactly is being recorded, and whether the mouse pointer is included: Screen recording: Memory leaks regardless of mouse pointer setting Window recording with mouse pointer: Memory leaks when the mouse cursor moves Window recording with no mouse pointer: No major leak Rectangular region: No major leak regardless of mouse pointer setting