canonical / mir

The Mir compositor
GNU General Public License v2.0
620 stars 99 forks source link

Resizing X11 applications leaks Xwayland memory #3551

Open Saviq opened 4 weeks ago

Saviq commented 4 weeks ago

Steps to reproduce:

  1. Open any system monitor application, take note of the baseline ram usage.
  2. Run miral-shell with x11: WAYLAND_DISPLAY=wayland-99 ./build/bin/miral-shell --enable-x11 true
  3. Run any x11 app. For example xmore
  4. Repeatedly resize the application
  5. Watch as Xwayland's memory usage skyrockets

Even after you stop resizing the application, the memory usage will remain high. Closing the application also doesn’t free the memory. Looking at processes hogging the most memory, it looks like Xwayland is responsible for this. The version which this bug occurs on is 23.2.6.

I was able to reproduce this bug on 2.17 and main.

Saviq commented 4 weeks ago

Can confirm that gnome-shell does not show this with the same Xwayland.

Saviq commented 2 weeks ago

xtrace, xrestop are possible utils that could help here.

tarek-y-ismail commented 2 weeks ago

Seems to affect 2.16, but not 2.13

Saviq commented 2 weeks ago

Seems to affect 2.16, but not 2.13

That's starting to sound to me like fallout from #2962. That won't help pinpointing the issue, as this was a huge rework that you can't really bisect through.

tarek-y-ismail commented 2 weeks ago

Seems to affect 2.16, but not 2.13

Testing again, it seems to occur as far back as 2.5.0. So either it's not consistent, explaining why it didn't happen on 2.13 when I first tried it, or it depends on something other than Mir?