Closed Bug 1978207 Opened 3 months ago Closed 3 months ago

[wayland][SW-WR] Slowly resizing window causes memory leak and elements to flicker

Categories

(Core :: Widget: Gtk, defect, P2)

Firefox 142
defect

Tracking

()

VERIFIED FIXED
143 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox-esr140 --- unaffected
firefox140 --- unaffected
firefox141 --- unaffected
firefox142 --- verified
firefox143 --- verified

People

(Reporter: ke5trel, Assigned: stransky)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: memory-leak, regression)

Attachments

(1 file)

STR:

  1. Disable hardware acceleration so it falls back to SW-WR on Ubuntu 25.04 (Wayland).
  2. Slowly resize the window.

Expected:
Total system memory usage remains stable.

Actual:
Total system memory usage grows rapidly while resizing and remains high. Elements sometimes flicker during resizing.

The memory growth is not recorded in System Monitor's Processes list and not attributed to any explicit allocation in about:memory.
Closing window recovers memory.

Does not happen with MOZ_ENABLE_WAYLAND=0 or HW-WR.

Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=dc6805af959576f619df93c9042e22f6115696c8&tochange=dfa8ff6ede6d3a7a42e304e626d8ded4d1922efa

Regressed by Bug 1973890.

:stransky, since you are the author of the regressor, bug 1973890, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(stransky)

We should also track IPC memory used here.

When WaylandBuffer transaction is detached from compositor, remove it from WaylandSurface.

Assignee: nobody → stransky
Status: NEW → ASSIGNED
Flags: needinfo?(stransky)
Pushed by stransky@redhat.com: https://github.com/mozilla-firefox/firefox/commit/c0ceea81fbd1 https://hg.mozilla.org/integration/autoland/rev/9b286c5c32d1 [Wayland] Remove detached WaylandBuffer transactions from WaylandSurface r=emilio
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch
Priority: -- → P2

Comment on attachment 9501769 [details]
Bug 1978207 [Wayland] Remove detached WaylandBuffer transactions from WaylandSurface r?emilio

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: Memleaks on SW-WR rendering if window is resized.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: Open Firefox on Wayland, resizing Firefox window by mouse. Check if used memory grows.
  • List of other uplifts needed: Bug 1977922
  • Risk to taking this patch: Medium
  • Why is the change risky/not risky? (and alternatives if risky): Release WaylandBuffer transactions rapidly from WaylandSurface, rather intrusive change.
  • String changes made/needed:
  • Is Android affected?: Yes
Attachment #9501769 - Flags: approval-mozilla-beta?
Flags: qe-verify+
QA Whiteboard: [uplift][qa-ver-needed-c143/b142]

Reproduced the issue on Firefox 142.0a1 (2025-07-19) on Ubuntu 24.04 with hw accel disabled, which caused the system to crash after all the ram was used.

The issue is fixed on Firefox 143.0a1 (2025-07-22) on the same system. Will verify the fix on beta as well.

Comment on attachment 9501769 [details]
Bug 1978207 [Wayland] Remove detached WaylandBuffer transactions from WaylandSurface r?emilio

Approved for 142.0b3

Attachment #9501769 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Pushed by dsmith@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2ef1e308caef https://hg.mozilla.org/releases/mozilla-beta/rev/9187c1a58518 [Wayland] Remove detached WaylandBuffer transactions from WaylandSurface r=emilio,a=dsmith

Verified that this is fixed on Firefox 142.0b3 (treeherder build) on Ubuntu 24.04.

Status: RESOLVED → VERIFIED
QA Whiteboard: [uplift][qa-ver-needed-c143/b142] → [uplift][qa-ver-done-c143/b142]
Flags: qe-verify+
Regressions: 1979106
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: