xyproto / wallutils

:city_sunset: Utilities for handling monitors, resolutions, wallpapers and timed wallpapers
BSD 3-Clause "New" or "Revised" License
463 stars 17 forks source link

Unreasonably high memory usage on settimed #22

Closed n5q closed 2 years ago

n5q commented 3 years ago

I am currently running settimed (feh backend) which was installed as part of the wallutils package (5.9.0-1) on i3-gaps (4.18.2-2) under Arch Linux. The program works as intended, fading between wallpapers throughout the day however I have noticed that the program uses an unreasonable amount of memory while running in the background regardless of if the program is launched via the i3 config file or manually.

I am using the options settimed -m zoom /usr/share/backgrounds/gnome/adwaita-timed.xml which does set the desired wallpaper however it takes up over a gigabyte of memory. Screenshot from 2020-08-25 12-05-56

Running the program manually produces the following output

Launching event loop for: /usr/share/backgrounds/gnome/adwaita-timed.xml
Using the GNOME Timed Wallpaper format
Initial transition event at 08:00 (82% complete)
Progress: 4h7m38s
Up to: 13:00
Window: 5h
Cooldown: 30m
Loop wait: 5s
Transition type: overlay
From filename /usr/share/backgrounds/gnome/adwaita-morning.jpg
To filename /usr/share/backgrounds/gnome/adwaita-day.jpg
Setting /usr/share/backgrounds/gnome/adwaita-morning.jpg.
Using the Feh backend.
feh --bg-fill /usr/share/backgrounds/gnome/adwaita-morning.jpg
Crossfading between images.
Setting /tmp/_settimed.jpg.
Using the Feh backend.
feh --bg-fill /tmp/_settimed.jpg
Activating events in 15m
xyproto commented 3 years ago

Thanks for reporting! I'll look into this.

n5q commented 3 years ago

It appears as if this is only an issue when there is a transitioning wallpaper as it is now using 140mb of memory when not transitioning. Still high memory usage but not as bad as before

n5q commented 3 years ago

Possible memory leak when transitioning?

xyproto commented 3 years ago

Cross-fading two large images in memory uses some memory, so it's not entirely unreasonable, but I'm planning to both rewrite and profile settimed.

asif-mahmud commented 3 years ago

i ran into the same problem, but in my case it was using some gb of ram ! i am on archlinux, using wallutils version - 5.9.0-2

xyproto commented 2 years ago

I have rewritten the event system and updated the settimed command. Could you please check if settimed from the main branch now works as expected?

xyproto commented 2 years ago

This might also be improved when compiling with Go 1.17.

xyproto commented 2 years ago

There's a new release of wallutils: 5.10.0. Please re-open this issue if this should still be a problem.