swww icon indicating copy to clipboard operation
swww copied to clipboard

Memory leak when switching wallpapers with DPM off

Open xiaohuirong opened this issue 1 year ago • 1 comments

I have a script that switches wallpapers on schedule. After turning off the monitor power using a tool dpms-off based on the zwlr_output_power_manager_v1 protocol, I noticed that the memory usage of swww-daemon gradually increases with each wallpaper switch. I tried https://github.com/LGFae/swww/pull/375, but it doesn't seem to work.

swww: built with commit 0db3f4e WM: wayfire

xiaohuirong avatar Dec 03 '24 12:12 xiaohuirong

Based on my testing, it appears that memory leaks occur due to unsuccessful (in case of dpms-off) or overlapping transitions. As temporary fix you could use --transition-type none or kill swww-daemon before and start it after dpms-off.

kerty0 avatar Dec 07 '24 15:12 kerty0

Same happens in Hyprland when using .gifs as wallpapers, however, --transition-type none does not seem to "fix" it. When using static images, disabling a monitor decreases the memory usage; enabling it back increases it back to the previous amount.

When using GIFs, disabling my primary monitor with hyprctl makes no change in the process' used memory, however enabling it back adds to it, so it just keeps adding up.

edit: just noticed the last version (0.9.5) is almost a year old. building from source (0.9.5-masterV3) seems to have fixed it.

danilo-alm avatar May 25 '25 10:05 danilo-alm

Thanks, @danilo-alm, I am going to assume this has been fixed in the latest versions.

LGFae avatar May 30 '25 14:05 LGFae