GNOME Bugzilla – Bug 680414
Notification daemon appears to leak memory
Last modified: 2013-01-02 17:33:30 UTC
Sending a lot of notifications makes the used memory go up quite quickly, but it doesn't decrease later.
Please provide a valgrind log and basic version and distribution information (gnome-shell, libnotify, etc).
I'm also seeing a memory leak in GNOME, but I hadn't associated it with notifications. I'm willing to try running it in valgrind, but I'm not really sure how to do that. Is the easiest way to disable gdm3 and use startx with something like 'valgrind gnome-shell &>gnome-shell-valgrind.log' in .xinitrc?
(In reply to comment #2) > Is the easiest way to disable gdm3 and use startx with something like > 'valgrind gnome-shell &>gnome-shell-valgrind.log' in .xinitrc? No - gnome-shell expects at least gnome-session and gnome-settings-daemon to be running as well. The easiest way is probably to do valgrind gnome-shell --replace in your running session.
That worked, thanks. Unfortunately the log file is huge, I'm uploading it to <http://www.realh.co.uk/misc/nohup.out>. I hope you can manage to sift some useful information out of it. If it would be more helpful for me to run it for a much shorter time, running fewer applications but forcing more notifications, please let me know.
Created attachment 232399 [details] [review] notificationDaemon: Fix style
Created attachment 232400 [details] [review] notificationDaemon: Prevent doing redundant work We already calculated and created a gicon based on the icon and hints.
Created attachment 232401 [details] [review] notificationDaemon: Clean up code paths While we really need to clean up the bad MessageTray API, this is a quick step to allow for a cleaner codebase for the future.
Created attachment 232402 [details] [review] messageTray: Support setImage(null) to mean unsetImage() This is a quick API change that should clean up some conditionals.
Created attachment 232403 [details] [review] notificationDaemon: Merge two pieces of similar code Use the same code for parsing notification data to handle both icons and images.
Created attachment 232404 [details] [review] notificationDaemon: Clean up icon/image handling Make the logic for this clearer and easier to see. -- This is a branch that I wrote this morning for unrelated reasons. It should use less memory since it won't use the stex for notification image pixbufs, which is a good idea.
Review of attachment 232399 [details] [review]: Yes.
Review of attachment 232400 [details] [review]: Yes.
Review of attachment 232401 [details] [review]: Ok
Review of attachment 232402 [details] [review]: Yes (although it would be nicer to avoid destroying the StBin every time)
Review of attachment 232403 [details] [review]: Ok
Review of attachment 232404 [details] [review]: ::: js/ui/notificationDaemon.js @@ +388,1 @@ let image; image = null here, or you're passing undefined if !gimage.
Created attachment 232540 [details] [review] notificationDaemon: Clean up icon/image handling Make the logic for this clearer and easier to see.
Comment on attachment 232540 [details] [review] notificationDaemon: Clean up icon/image handling Yes
Attachment 232399 [details] pushed as fbc6292 - notificationDaemon: Fix style Attachment 232400 [details] pushed as c11cbff - notificationDaemon: Prevent doing redundant work Attachment 232401 [details] pushed as fe7ee1e - notificationDaemon: Clean up code paths Attachment 232402 [details] pushed as 155f9dc - messageTray: Support setImage(null) to mean unsetImage() Attachment 232403 [details] pushed as 1bd3494 - notificationDaemon: Merge two pieces of similar code Attachment 232540 [details] pushed as bd38388 - notificationDaemon: Clean up icon/image handling