! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Memory Leak in xfce4-notifyd
Status:
RESOLVED: FIXED
Product:
Xfce4-notifyd
Component:
general

Comments

Description ToZ editbugs 2016-07-29 03:21:43 CEST
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).
Comment 1 ToZ editbugs 2016-07-29 03:50:10 CEST
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.
Comment 2 ToZ editbugs 2016-07-29 18:46:37 CEST
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.
Comment 3 ToZ editbugs 2016-07-31 16:38:00 CEST
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.
Comment 4 Simon Steinbeiss editbugs 2016-08-06 23:26:58 CEST
Thanks for finding the leak and the patch! Pushed to master: https://git.xfce.org/apps/xfce4-notifyd/commit/?id=26e04bf1d493e3cc6cfa28a4b010d6d74e3176a8

Bug #12733

Reported by:
ToZ
Reported on: 2016-07-29
Last modified on: 2016-08-06

People

Assignee:
Jérôme Guelfucci
CC List:
1 user

Version

Attachments

valgrind report (28.31 KB, application/octet-stream)
2016-07-29 03:21 CEST , ToZ
no flags
valgrind report for xubuntu 16.04 (28.83 KB, application/octet-stream)
2016-07-29 03:50 CEST , ToZ
no flags
destroy the cairo surface too patch (548 bytes, patch)
2016-07-29 18:46 CEST , ToZ
no flags
valgrind report (44.03 KB, application/octet-stream)
2016-07-31 16:38 CEST , ToZ
no flags

Additional information