YaLTeR / niri

A scrollable-tiling Wayland compositor.
https://matrix.to/#/#niri:matrix.org
GNU General Public License v3.0
4.14k stars 123 forks source link

memory leaking #772

Closed xcccdjsn closed 2 weeks ago

xcccdjsn commented 3 weeks ago

I have used swaylock, hyprlock and gtklock, but all of them will increment memory amount every time after using it.

System Information

YaLTeR commented 3 weeks ago

Could it be some mesa GPU objects that will get garbage collected later?

I guess we need to check with the Tracy memory profiler or something to see if there are any leaks on the Rust side.

YaLTeR commented 3 weeks ago

I added Tracy profiling. I can see the Rust memory increase every time I run swaylock. It's a bit hard to tell what gets leaked. Seems like some surface data might have a ref cycle?

YaLTeR commented 3 weeks ago

Found it: https://github.com/Smithay/smithay/pull/1573

xcccdjsn commented 3 weeks ago

I have not test other window manager.

I found other application also can cause memory leaking, especially kitty. Spawn multiple kitty in short time, and then close them quickly. I did it many times resulting in lot of memory leaking.

This is my result screenshots. I also got memory usage from btop which derived same result.

IMG20241102193500 IMG20241102193516 IMG20241102193539

GallowsDove commented 3 weeks ago

That is exactly what I've been rambling about in matrix room a few weeks ago. Recommend looking at my smithay issue and other linked issues.

https://github.com/Smithay/smithay/issues/1562

YaLTeR commented 3 weeks ago

Screen locker leak should be fixed with 600cffb009cde7ed3e04b9f53365ad56cf2d6d6b

YaLTeR commented 2 weeks ago

@xcccdjsn could you please test cosmic-comp for your kitty issue? I believe it's not niri specific and there's already a Smithay issue open.

YaLTeR commented 2 weeks ago

Gonna close this assuming it's the Smithay issue.