Created attachment 6755 valgrind report Using git version. There appears to be a memory leak. Memory use increases with each notification. Eventually leads to X hang. Attached is a valgrind report (and this is with only one notification event). Not sure if its correct since I couldn't build xfce4-notifyd with --enable-debug=full (there are errors).
Created attachment 6756 valgrind report for xubuntu 16.04 The previous valgrind report was for Arch linux. This report is for xubuntu 16.04. The memory leak does not appear to be as big on xubuntu as it is on Arch.
Created attachment 6758 destroy the cairo surface too patch The attached patch destroys the cairo surface too when drawing the window. This fixes a huge part of the memory leak on GTK3.20. There is still another slow leak - I'll see if I can find it.
Created attachment 6760 valgrind report Did some further testing and have not been able to resolve any more leaks. The attached valgrind report suggests that there is a leak at notify_notify (xfce-notify-daemon.c:1056) with the GVariant variables. However, freeing them after use makes no difference to memory usage. There is a slight continual leak of memory on my system for about 10MB until it stops leaking (which may indicate just normal usage). Also, if the notify deamon is idle for a while, the process stops and restarts when next needed returning to its base memory allocation. This issue would only affect those gtk 3.20 systems that have a lot of notifications, but freeing the cairo surface (my previous patch) fixes that.
Thanks for finding the leak and the patch! Pushed to master: https://git.xfce.org/apps/xfce4-notifyd/commit/?id=26e04bf1d493e3cc6cfa28a4b010d6d74e3176a8