Closed Bug 1272078 Opened 8 years ago Closed 7 years ago

Leak of dom/memory-file-data entries persists after disabling addon

Categories

(Core :: DOM: Core & HTML, defect)

x86_64
Windows 10
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1353629

People

(Reporter: bugzilla.mozilla.org, Assigned: baku)

References

Details

(Whiteboard: [MemShrink:P2] btpp-active)

Attachments

(3 files)

I have an addon that causes the following to leak in the parent process:

> 523.04 MB (100.0%) -- explicit
> ├──380.46 MB (72.74%) -- dom
> │  ├──380.06 MB (72.67%) -- memory-file-data
> │  │  ├──380.06 MB (72.66%) -- large
> │  │  │  ├──298.62 MB (57.09%) ++ (1648 tiny)
> │  │  │  └───81.45 MB (15.57%) ── file(length=119276, sha1=6db3e019e4fa163abbf4e5f5fd5bb102fc4b6db6) [695]

it's not related to object URLs:

> 0 ── host-object-urls


Searching the GC/CC edge logs for Blobs falls far short of the leaked entries:

> $ grep Blob cc-edges.9772.1462992097.log | wc -l
> 21


The entries persist even after disabling the addon.


STR with attached addon:

1. create blank profile (nightly)
2. install addon
3. open a youtube playlist and let it play
4. switch to tab groups view and leave it open for a minute. it should continuously draw thumbnails from the playing youtube videos
5. close tab view, go to about:addons, disable tab groups addon
6. open about:memory, measure
7. observe leaked dom/memory-file-data entries


The addon has gone through several rounds of fix window / listener / compartment leaks. This is the last issue which I cannot pin down. I suspect it may be related to the page thumbnail service.
I noticed that those entries also show up in the child process, but they won't get collected even after closing all tabs except about:memory, which closes the child process.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [MemShrink]
Whiteboard: [MemShrink] → [MemShrink] btpp-active
I wasn't able to reproduce this before, but today it happens every single time I try, for some reason...

Can you confirm that something similar happens regardless of the add-on, by showing previews in the windows taskbar, loading up a youtube video and moving the mouse over the taskbar to show the tab previews? I also see a hash build-up like that, although not to the same extent probably because those don't update as often.
Kyle have you had a chance to look at this again since bug 1272160 landed?
Flags: needinfo?(khuey)
I can reproduce this.  The EnsureBlobForBackgroundManager at https://hg.mozilla.org/mozilla-central/rev/0ed63658fcba#l2.199 seems bogus.  What if this is the main thread?  The main thread code used to not do this, see https://hg.mozilla.org/mozilla-central/rev/0ed63658fcba#l2.478.  We just pile up blob actors on the PBackground thread, which result in keeping the data alive.
Flags: needinfo?(khuey) → needinfo?(amarchesini)
I discussed this issue with bent, centuries ago, and we both agreed that it's important (in particular for MessagePort) to create a PBackground actor also if the blob is running on main-thread only.

I want to run this STR and see if maybe the life-time of blobs is broken or if there is something keeping them alive in the wrong way.
Flags: needinfo?(amarchesini)
It's pretty easy to reproduce.
Assignee: khuey → amarchesini
Whiteboard: [MemShrink] btpp-active → [MemShrink:P2] btpp-active
Andrea is this still on your radar?
Flags: needinfo?(amarchesini)
(In reply to Eric Rahm [:erahm] from comment #7)
> Andrea is this still on your radar?

Yes it is.
Flags: needinfo?(amarchesini)
Attached patch testcaseSplinter Review
This testcase reproduces the issue. What we can clearly see here is that the PBlobParent is never released.
Attached patch patch - WIPSplinter Review
This patch fixes the leak, but I'm still debugging if this is the right solution.
I've been running with that patch on two machines now for a week now and things seem fine. The massive leak provoked by Tab Center is gone.
*poke* If the patch works it would be great if it could be landed. I'm still experiencing those leaks that force me to restart the browser every so often.
Flags: needinfo?(amarchesini)
This appears to be affecting tab center users: https://github.com/bwinton/TabCenter/issues/741
Flags: needinfo?(amarchesini)
Andrea, did you ever get a chance to evaluate your WIP patch? We're still getting reports/questions from users in #memshrink.
Flags: needinfo?(amarchesini)
Still running with that patch on DevEd, here.
I haven't forgotten this bug. I'm the middle of a big refactoring of PBlob.
Finger-crossed it should be finished between this week and the next one.
Blocks: 1353629
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Flags: needinfo?(amarchesini)
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: