Closed Bug 1908393 Opened 2 years ago Closed 2 years ago

BounceTrackingState never gets destroyed even when the tab closes

Categories

(Core :: Privacy: Anti-Tracking, defect, P1)

defect

Tracking

()

RESOLVED FIXED
130 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- fixed
firefox128 --- wontfix
firefox129 --- wontfix
firefox130 --- fixed

People

(Reporter: emz, Assigned: emz)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Both BrowsingContextWebProgress and the static map sBounceTrackingStates have strong reference to BounceTrackingState. That means even when a tab gets destroyed and with it BrowsingContextWebProgress we keep BounceTrackingState alive. Since we create one BounceTrackingState per tab but don't destroy it that means we effectively leak them. For longer sessions with a lot of tabs this could have a negative impact on memory usage.

The map was introduced in Bug 1839916, but the feature was only recently enabled in release in Bug 1899130. 128+ is affected. At this point I consider it low severity since we don't leak that much memory. If the issue becomes more severe we can disable the feature in release via Nimbus.

Regressed by: 1899130
Assignee: nobody → pbz
Status: NEW → ASSIGNED

Might be nice to uplift a fix to ESR when we have it.

This ensures that the lifetime of a BounceTrackingState is tied more closely to the lifetime of a tab.

Pushed by pzuhlcke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0f6febee3f34 Only hold strong references to BounceTrackingState in BrowsingContextWebProgress. r=nika,anti-tracking-reviewers,timhuang
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch

Please nominate this for ESR128 approval. It grafts cleanly.

Flags: needinfo?(pbz)

Comment on attachment 9413576 [details]
Bug 1908393 - Only hold strong references to BounceTrackingState in BrowsingContextWebProgress. r=#anti-tracking!,nika!

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Requested by release manager.
  • User impact if declined: Potentially leaking memory / unnecessary objects the more tabs get opened. This would impact longer sessions more.
  • Fix Landed on Version: 130
  • Risk to taking this patch: Medium
  • Why is the change risky/not risky? (and alternatives if risky): Not a completely trivial patch therefore medium risk. The patch changes how BounceTrackingState (per tab) is managed and there is a small risk we're regressing further.
Flags: needinfo?(pbz)
Attachment #9413576 - Flags: approval-mozilla-esr128?

Comment on attachment 9413576 [details]
Bug 1908393 - Only hold strong references to BounceTrackingState in BrowsingContextWebProgress. r=#anti-tracking!,nika!

Approved for 128.2esr.

Attachment #9413576 - Flags: approval-mozilla-esr128? → approval-mozilla-esr128+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: