Last Comment Bug 678811 - Huge leaks with Video DownloadHelper after closing large changeset diffs on hg.m.o
: Huge leaks with Video DownloadHelper after closing large changeset diffs on h...
Status: RESOLVED FIXED
[MemShrink:P3]
:
Product: Core
Classification: Components
Component: General (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Nicholas Nethercote [:njn] (on vacation until July 11)
:
Mentors:
Depends on: DMD
Blocks: LeakyAddons
  Show dependency treegraph
 
Reported: 2011-08-14 05:19 PDT by Renaud Durlin
Modified: 2012-11-19 16:51 PST (History)
9 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
DMD output (56.68 KB, text/plain)
2011-11-02 22:39 PDT, Nicholas Nethercote [:njn] (on vacation until July 11)
no flags Details

Description Renaud Durlin 2011-08-14 05:19:58 PDT
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)
Comment 1 Nicholas Nethercote [:njn] (on vacation until July 11) 2011-08-14 17:14:55 PDT
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.
Comment 2 Andrew McCreight [:mccr8] 2011-08-14 17:19:15 PDT
Wow, that is a high % of heap-unclassified.
Comment 3 Nicholas Nethercote [:njn] (on vacation until July 11) 2011-08-14 18:54:26 PDT
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.
Comment 4 Nicholas Nethercote [:njn] (on vacation until July 11) 2011-08-14 18:55:04 PDT
(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.
Comment 5 Boris Zbarsky [:bz] (Out June 25-July 6) 2011-08-25 10:53:13 PDT
So the most obvious reason would be if the addon somehow keeps the DOM alive, right?
Comment 6 Michel Gutierrez 2011-10-12 11:44:45 PDT
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.
Comment 7 Andrew McCreight [:mccr8] 2011-10-12 11:51:15 PDT
Renaud, can you please confirm that this fixes the problem for you?
Comment 8 Nicholas Nethercote [:njn] (on vacation until July 11) 2011-11-01 17:45:06 PDT
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
Comment 9 Nicholas Nethercote [:njn] (on vacation until July 11) 2011-11-02 22:39:57 PDT
Created attachment 571562 [details]
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.

Note You need to log in before you can comment on or make changes to this bug.