Closed Bug 678811 Opened 13 years ago Closed 13 years ago

Huge leaks with Video DownloadHelper after closing large changeset diffs on hg.m.o

Categories

(Core :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: renaud.durlin, Assigned: n.nethercote)

References

Details

(Whiteboard: [MemShrink:P3])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0a1) Gecko/20110813 Firefox/8.0a1
Build ID: 20110813030746

Steps to reproduce:

I try the steps in bug 678376 and see that with my profile, the memory is not freed after I close the tab. I tried disabling my addon one by one and found that the problem is caused by Video DownloadHelper.

1) install Video DownloadHelper (https://addons.mozilla.org/en-US/firefox/addon/video-downloadhelper/)
2) go to https://hg.mozilla.org/tracemonkey/rev/74b2b46fca7d
3) close the tab
4) open about:memory, hit 'Minimize memory usage'


Actual results:

681.94 MB (100.0%) -- explicit
+--641.11 MB (94.01%) -- heap-unclassified
+---19.99 MB (02.93%) -- js
¦   +--10.73 MB (01.57%) -- compartment([System Principal], 0x7b0f800)
¦   ¦  +---5.50 MB (00.81%) -- (8 omitted)
¦   ¦  +---5.23 MB (00.77%) -- gc-heap
¦   ¦      +--5.23 MB (00.77%) -- (7 omitted)
¦   +---7.08 MB (01.04%) -- gc-heap-chunk-dirty-unused
¦   +---2.19 MB (00.32%) -- (6 omitted)
+---18.74 MB (02.75%) -- storage
¦   +--18.74 MB (02.75%) -- sqlite
¦      +--13.98 MB (02.05%) -- urlclassifier3.sqlite
¦      ¦  +--13.90 MB (02.04%) -- cache-used
¦      ¦  +---0.08 MB (00.01%) -- (2 omitted)
¦      +---4.76 MB (00.70%) -- (10 omitted)
+----2.10 MB (00.31%) -- (5 omitted)
Whiteboard: MemShrink
I can reproduce this.  On my Linux64 box with a new profile, after minimizing memory usage many times I have this:

1,004.01 MB (100.0%) -- explicit
├────964.64 MB (96.08%) -- heap-unclassified
├─────32.05 MB (03.19%) -- js
│     ├──14.03 MB (01.40%) -- compartment([System Principal], 0x7f1ffc47e000)
│     │  ├───7.51 MB (00.75%) -- gc-heap
│     │  │   └──7.51 MB (00.75%) -- (7 omitted)
│     │  └───6.52 MB (00.65%) -- (8 omitted)
│     ├───8.00 MB (00.80%) -- stack
│     ├───7.12 MB (00.71%) -- gc-heap-chunk-dirty-unused
│     └───2.90 MB (00.29%) -- (5 omitted)
└──────7.32 MB (00.73%) -- (6 omitted)

It's not a zombie compartment.  DMD will be useful here.
Depends on: DMD
Wow, that is a high % of heap-unclassified.
OS: Windows 7 → All
Hardware: x86_64 → All
How annoying:  I just spent 45 minutes doing a DMD run.  After minimizing memory usage, the ~1GB of dark matter was not present -- explicit dropped to ~30MB.  

Hmm, I just tried to reproduce without DMD and failed -- the memory went away.
(In reply to Nicholas Nethercote [:njn] from comment #3)
> How annoying:  I just spent 45 minutes doing a DMD run.  After minimizing
> memory usage, the ~1GB of dark matter was not present -- explicit dropped to
> ~30MB.  
> 
> Hmm, I just tried to reproduce without DMD and failed -- the memory went
> away.

In both cases that was with a local copy of the hg.m.o site, though.
So the most obvious reason would be if the addon somehow keeps the DOM alive, right?
There was indeed a memory leak issue that has been fixed in 4.9.6a3: http://www.downloadhelper.net/install-beta.php?version=4.9.6a3
This fix will be integrated into 4.9.6 which will soon be released.
Renaud, can you please confirm that this fixes the problem for you?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: MemShrink → [MemShrink]
Assignee: nobody → nnethercote
Whiteboard: [MemShrink] → [MemShrink:P3]
STR:
- Create a new profile
- in about:config, create a new option "extensions.checkCompatibility.nightly", make it "false"
- Install the add-on (v4.9.5) from https://addons.mozilla.org/en-US/firefox/addon/video-downloadhelper/
- Restart when requested
- Open about:memory
- Open https://hg.mozilla.org/tracemonkey/rev/74b2b46fca7d (I have a local copy which is good enough).  The VDH coloured ball icon should spin.  Then close the tab.
- "Minimize memory usage" in about:memory.  Memory usage stays really high (~1GB), and 90%+ is "heap-unclassified".

I confirmed that v4.9.6a3 fixes the problem -- minimizing memory usage drops "explicit" down to ~80MB.

FWIW, here is the bug report:
http://bugzilla.downloadhelper.net/show_bug.cgi?id=309
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Attached file DMD output
FWIW, I did a DMD run, taking the snapshot after closing a modified (smaller) local version of https://hg.mozilla.org/tracemonkey/rev/74b2b46fca7d had been closed.  The data is attached.  Lots of Html5-ish things, is that missing DOM reporters?  And some CSS stuff, as usual.
Blocks: LeakyAddons
You need to log in before you can comment on or make changes to this bug.