Closed Bug 1692841 Opened 4 years ago Closed 3 years ago

SourceMapURLService only relies on will-navigate to clear its internal state

Categories

(DevTools :: Framework, task, P3)

task

Tracking

(Fission Milestone:M7a, firefox90 fixed)

RESOLVED FIXED
90 Branch
Fission Milestone M7a
Tracking Status
firefox90 --- fixed

People

(Reporter: jdescottes, Assigned: ochameau)

References

(Blocks 1 open bug)

Details

(Whiteboard: dt-fission-m3-mvp)

Attachments

(1 file)

The SourceMapURLService is only relying on the will-navigate event to clear its internal state, and it only does so for the first target of the toolbox.

This most likely means that the SourceMapURLService is not working correctly in target switching scenarios. For instance:

  • enable fission
  • navigate to mozilla.org
  • open devtools on the inspector (ensures starting the sourcemap service)
  • navigate to google.com
  • navigate to youtube.com
  • navigate to various domains...

ER: The internal maps should be cleared.
AR: _urlToIDMap grows indefinitely. Note that this is keyed by URL so you need to visit new domains to make it grow a lot.

Also, regardless of target-switching, _mapsById is never-ever cleared. This might explain why enabling sourcemaps leaks a lot of memory.

The logic is also really odd. When the target navigates, the SourceMapURLService will stop watching for SOURCE resources. It probably relies on the UI making another call to one of its APIs?

We should add a test for this and fix the source map service in target switching scenarios.

(In reply to Julian Descottes [:jdescottes] from comment #0)

Also, regardless of target-switching, _mapsById is never-ever cleared. This might explain why enabling sourcemaps leaks a lot of memory.

The map easily grows to have thousands of items after just opening the MBT on a regular profile with a dozen of tabs.

Whiteboard: dt-fission-m3-triage
Blocks: 1698891
Whiteboard: dt-fission-m3-triage
Fission Milestone: --- → M7a
Whiteboard: dt-fission-m3-triage → dt-fission-m3-mvp
Assignee: nobody → poirot.alex
Depends on: 1678254
Status: NEW → ASSIGNED
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ccaa1d7b0dc2
[devtools] Clear source map url service on target switch. r=jdescottes
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: