LGFae / swww

A Solution to your Wayland Wallpaper Woes
GNU General Public License v3.0
2.38k stars 70 forks source link

Memory Usage keeps increasing #341

Open fluffylea opened 4 months ago

fluffylea commented 4 months ago

Description

Every time i switch wallpaper using swww img, there is a line of log output, and the memory usage of the program goes up.

Steps to reproduce

Expected Behaviour

The Memory used by previous iterations of the wallpaper being free'd again.

Actual Behaviour

The Memory usage keeps going up with every wallpaper change.

Version

Current main, commit 2da1f57e6b0dbc2d6b62cb940a426486710cf14e

Interesting observations

On v0.9.4, it functions "correctly" with it freeing the memory after the animation On v0.9.5, the virtual memory keeps increasing, but the resident set size goes back after the animation On current main, both keep going up until it crashes

LGFae commented 3 months ago

Try using swww-daemon --format xrgb to initialize the daemon. See if it fixes it. You can test it simply by checking whether the log is still printing all those messages.

Alternatively, are you using fractional scale? If yes, can you please check if this still happens without any scaling?

eaxly commented 2 months ago

Hello there! I am having the same issue on a 1920x1080, no fractional scaling monitor. Even when using swww-daemon --format xrgb, this still happens, when switching wallpapers.

LGFae commented 2 months ago

@eaxly are you on the latest git version?

jdvmat commented 2 months ago

Hi, when using the git version (0.9.5-masterV2) in debian unstable with sway, I don't have the issue for swww-daemon --format xrgb with transition-type=none. In this case changing between (heavy) gifs keeps the memory low (<50Mb), which is really impressive :)

If --format xrgb is not specified then --format rgb is used and the memory keeps increasing steadely when changing images fast, although in this case the increment is slow. When using transition-type=simple I have the same issue as documented in this thread (memory increases rapidly until using whole RAM).

I didn't test 0.9.4 and 0.9.5 since in those releases I'm suffering #357

eaxly commented 2 months ago

@eaxly are you on the latest git version?

I am now using a different monitor with 3840x2160 res and 1.5 scaling on hyprland, and the issue doesn't seem to persist, at least when initializing swww with swww --format xrgb. When I set a larger gif as wallpaper swww uses some 66Mb all the way to around 200Mb, depending on the wallpaper (some of the wallpapers I use are pretty large, so this is expected i guess). But when switching to some static image, swww memory usage drops down to <3Mb. It could very well be that on the old monitor I wasn't using the latest git version of swww, but right now, I no longer have this issue.

eaxly commented 2 months ago

Also, I forgot to add that no matter the transition-type of swww, Memory usage stays the same for me.