swww icon indicating copy to clipboard operation
swww copied to clipboard

How to limit ram usage for swww?

Open orcbolg3612 opened this issue 1 year ago • 4 comments

image I often encounter memory leak problems with swww, every time I change the .gif desktop, swww uses an additional 100MB to 1.5GB of RAM and then slowly reduces RAM usage over time. I'm currently using fedora 40 with hyprland, I tried swww with arch, debian and this error also appears with both other distros.

orcbolg3612 avatar Apr 25 '24 10:04 orcbolg3612

Does this happen if you use swww img --transition none?

LGFae avatar Apr 25 '24 12:04 LGFae

Does this happen if you use swww img --transition none?

No

orcbolg3612 avatar Apr 25 '24 19:04 orcbolg3612

Alright. Well, in that case, this is not a memory leak. Specially since memory usage goes down later. This is expected behavior: we allocate some memory to do the transition, while the animations are waiting for the transitions to finish. Once the transitions are done, they deallocate their internal structures and the animation starts.

There is not any way of making this smaller, other than skipping transitions altogether with --transition none. The only alternative would be using a different gif with fewer frames in it, or with frames that change less.

LGFae avatar Apr 26 '24 02:04 LGFae