SUMMARY I use an extension to reproduce videos as wallpapers on my desktop. Actually I am contributing to the project on GitHub here: https://github.com/luisbocanegra/plasma-smart-video-wallpaper-reborn and I made a preview for the videos to see how the videos will be treated in some circumstances. I did a pull request (https://github.com/luisbocanegra/plasma-smart-video-wallpaper-reborn/pull/94) but we found a memory bug that can crash some weak computers. The RAM usage still increasing after close the media component and event closing the wallpaper settings window, the .destroy() method and garbage collector calls don't have any effect. The only way to reduce the RAM usage is restarting the plasmashell service. I tried other things like Load videos using webviews, using dynamic Video components bug nothing resolves this. STEPS TO REPRODUCE 1. Clone https://github.com/ArthurLobopro/plasma-smart-video-wallpaper-reborn/tree/feat-real-time-video-show 2. Build and Install using install.sh 3. Choose the extension as Wallpaper and add some videos 4. Click in Show videos list and after Click on settings button for each video added 5. See the RAM usage raising 6. Close the settings window OBSERVED RESULT The RAM usage keeps high, even closing the window EXPECTED RESULT The RAM usage should fall because the videos should be destroyed after closing the window SOFTWARE/OS VERSIONS Linux/KDE Plasma: Big Linux based on Manjaro KDE Plasma Version: 6.3.2 KDE Frameworks Version: 6.11.0 Qt Version: 6.8.2 ADDITIONAL INFORMATION If I change the wallpaper to an image and after I change again to the plugin the RAM usage raises the same way, something aren't stopping and cleaning unused media players
We don't maintain QtMultimedia, you'll want to talk to Qt I guess.
Created attachment 179260 [details] test.qml For what it's worth I've had a quick look and I think there is no actual leak. What happens is that qtffmpeg doesn't fully de-initialize itself when you destroy the Video item. Specifically it holds on to its internal engine until a new media is set. As well as some global statics that only get cleared on app shutdown. https://codebrowser.dev/qt6/qtmultimedia/src/plugins/multimedia/ffmpeg/qffmpegmediaplayer.cpp.html#188 Depending on the video in question that would be more or less memory it uses, but it shouldn't keep growing forever. And indeed a simple test program I have attached doesn't, it rises for a bit and eventually stays within the same range.
Created attachment 179275 [details] Small Video with nothing I did a test with this video file with nothing. The file size is about to 4kb and for each time I opened the Dialog rendering it the RAM usage raises 20Mb to 40Mb for each time and keeping raising as I open and close the Dialog.