Created attachment 85940 [details] Massif log Run this. while true ; do notify-send asdfadf; done memory usage goes insane. Massif output implies problem is not a fault of notifications it's just that creates and deletes a /lot/ of dialogs.
> it's just that creates and deletes a /lot/ of dialogs. That is true; each new notification gets new Dialog while after the notification is closed, the dialog is closed/destroyed. I could possibly maintain a pool of 4 Dialogs and just reuse them (4 because 3 are on the screen at most while the 4th one would be the one sliding from top)
That seems like a bit like working round the problem and not actually fixing it. Creating and deleting a dialog shouldn't use memory.
What happens is that for each notification received there's a new Dialog created, but not displayed, it's just queued for when there's an empty space on screen and only then shown. Then it's deleteLater()'d so the memory is freed whenever it returns to the event loop. How do you suggest to fix the problem then (and what is the problem)? > Creating and deleting a dialog shouldn't use memory. Correct. But wrong component for that :)
It's true that deleting a dialog shouldn't take memory (are you sure isn't just heap fragmentation?) anyways, keeping a pool and reuse as much as possible looks something to do regardless to me
I don't think it's fragmentation as otherwise it wouldn't appear in massif which is tracking memory properly.
Git commit 8f76fed3a4cc3f1f16edc43d816c51f32ae05b88 by Martin Klapetek. Committed on 02/05/2014 at 15:44. Pushed by mklapetek into branch 'master'. Fix memory leaking in notifications Up to this patch there was a new Dialog created for each and every new notification incoming. After the notification was timed out, it would close and delete the Dialog, but somehow that didn't free all the memory and over time plasma-shell could get huuuge mem usage. Now the notifications reuse only 3 Dialogs the whole lifetime --> memory does not skyrockets anymore. Note that the original leak in Dialog might still be present, but notifications do not expose it anymore. REVIEW: 117903 M +7 -4 applets/notifications/package/contents/ui/NotificationPopup.qml M +6 -5 applets/notifications/package/contents/ui/Notifications.qml M +60 -26 applets/notifications/plugin/notificationshelper.cpp M +16 -3 applets/notifications/plugin/notificationshelper.h http://commits.kde.org/plasma-workspace/8f76fed3a4cc3f1f16edc43d816c51f32ae05b88