Created attachment 161914 [details] Stack trace SUMMARY I noticed that when you close Discover after installing Firefox the "plasma-discover" process keeps running using a lot of CPU for a minute or two. This does not happen with all apps, but it can be reproduced with Firefox (and also with other popular apps like VLC and Gimp). STEPS TO REPRODUCE 1. Open Discover 2. Search for Firefox (Flatpak) and open the package page (the one that shows the screenshots, version, size, license, ...) 3. Press "Install" on the top right corner 4. Wait for the installation to finish. 5. Close Discover 6. Open a terminal and look for running processes (with 'top' or similar) OBSERVED RESULT The "plasma-discover" process keeps running for a minute or two using a lot of CPU EXPECTED RESULT The "plasma-discover" process dies shortly after closing the Discover window. SOFTWARE/OS VERSIONS OS: Arch Linux KDE Plasma version: 5.27.8 KDE Frameworks version: 5.110.0 Qt version: 5.5.10 Discover: 5.27.8 ADDITIONAL INFORMATION I'm attaching a stack trace of the running plasma-discover process after the main window is closed. From the high number of QQuickItemPrivate::derefWindow() calls it seems that a large number of widgets are being destroyed. I haven't debugged it but Firefox in particular has almost 2000 reviews on Flathub, and I have a have a hunch that this might be the cause of the problem (is Discover preloading them or something?). On a second test, installing Firefox directly from the Discover search results (i.e. without opening the page) does not seem to cause this problem.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/discover/-/merge_requests/644
Git commit d4fc7536c77058c60e5320a4cd33e57bdb184d8d by Marco Martin. Committed on 28/09/2023 at 16:10. Pushed by mart into branch 'master'. Only preload a couple of screens worth of comments Discover used to preload every comment in order to have the scrollbar behaving as good as possible with variable height items. However some applications like Firefox have thousands of comments which will freeze firefox for minutes when scrolling quickly, eat a lot of memory and will make discover even slow to quit in order to delete the thousands of items it created. Cache only a couple of screens worth of comments, so that applications with few comments behave well and applications with thousands remain efficient M +2 -1 discover/qml/ReviewsPage.qml https://invent.kde.org/plasma/discover/-/commit/d4fc7536c77058c60e5320a4cd33e57bdb184d8d
Git commit acb816be7577f4a039a7dffd2b29a3dc627fa70c by Marco Martin. Committed on 28/09/2023 at 16:24. Pushed by mart into branch 'Plasma/5.27'. Only preload a couple of screens worth of comments Discover used to preload every comment in order to have the scrollbar behaving as good as possible with variable height items. However some applications like Firefox have thousands of comments which will freeze firefox for minutes when scrolling quickly, eat a lot of memory and will make discover even slow to quit in order to delete the thousands of items it created. Cache only a couple of screens worth of comments, so that applications with few comments behave well and applications with thousands remain efficient M +2 -1 discover/qml/ReviewsPage.qml https://invent.kde.org/plasma/discover/-/commit/acb816be7577f4a039a7dffd2b29a3dc627fa70c