Note: There are a few cases of duplicates in user autocompletion which are being worked on.

bugzilla.mozilla.org zombie compartment when using BugzillaJS extension

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: teoli, Assigned: ochameau)

Tracking

Trunk
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [MemShrink])

(Reporter)

Description

6 years ago
When the BugzillaJS extension is installed and activated, bugzilla.mozilla.org compartments stay forever.

STR:
1) Install BugzillaJS ( https://addons.mozilla.org/en-US/firefox/addon/bugzillajs/ )
2) Restart the browser
3) open about:memory?verbose in one tab
4) open any bug (like https://bugzilla.mozilla.org/show_bug.cgi?id=669545 )
5) refresh about:memory?verbose — the compartment appears
6) close the bmo tab
7) do several GC/GC+CC/Minimize memory; wait 10 minutes; do again — the compartment stays.

Go to about:addons, deactivate the extension (do not reboot Firefox):
1) do several GC/GC+CC/Minimize memory — the compartment disappear (usually at the next GC).

Compartment's about:memory?verbose values:
│   ├─────386,010 B (00.21%) -- compartment(https://bugzilla.mozilla.org/show_bug.cgi?id=669545)
│   │     ├──356,352 B (00.20%) -- gc-heap
│   │     │  ├──162,960 B (00.09%) -- shapes
│   │     │  ├──154,024 B (00.09%) -- objects
│   │     │  ├───37,568 B (00.02%) -- arena-unused
│   │     │  ├────1,392 B (00.00%) -- arena-headers
│   │     │  ├──────408 B (00.00%) -- arena-padding
│   │     │  ├────────0 B (00.00%) -- strings
│   │     │  └────────0 B (00.00%) -- xml
│   │     ├───28,832 B (00.02%) -- object-slots
│   │     ├──────826 B (00.00%) -- scripts
│   │     ├────────0 B (00.00%) -- string-chars
│   │     ├────────0 B (00.00%) -- mjit-code
│   │     ├────────0 B (00.00%) -- mjit-data
│   │     ├────────0 B (00.00%) -- tjit-code
│   │     └────────0 B (00.00%) -- tjit-data
│   │              ├──0 B (00.00%) -- allocators-main
│   │              └──0 B (00.00%) -- allocators-reserve

My guess: something in the extension is getting hold on the page, preventing it to be GCed.

Comment 1

6 years ago
https://github.com/gkoberger/BugzillaJS/issues/31
Thanks for the report, teoli2003!

Can you (or someone else) do me a favor and confirm that you *cannot* reproduce it using v1.2.2:

http://gkoberger.net/bugzillajs/index.html

Yet you *can* reproduce it using v1.2.1:

https://addons.mozilla.org/en-US/firefox/addon/bugzillajs/

I can reproduce it in 1.2.1, but the new build (the one from my personal site; v1.2.2) seems to be fine.  The absolute only difference is that I upgraded the SDK and rebuilt the add-on -- so it seems the error was with the SDK, not BugzillaJS.

If it works for you, I'll submit the new version to AMO :) Thanks again!
(In reply to comment #2)
> 
> I can reproduce it in 1.2.1, but the new build (the one from my personal
> site; v1.2.2) seems to be fine.  The absolute only difference is that I
> upgraded the SDK and rebuilt the add-on -- so it seems the error was with
> the SDK, not BugzillaJS.

Various SDK leaks were fixed in April (http://blog.mozilla.com/nnethercote/2011/04/20/some-big-memory-leaks-in-the-add-on-sdk-are-getting-fixed/).  I'm not sure when those fixes made it to the released SDK, but it's plausible that they were the problem.
(Reporter)

Comment 4

6 years ago
1.2.2 did the trick. After a couple of GC+CC the zombie compartments vanished, even w/o a Firefox restart :-) Thanks.

Thanks, before to set this bug to RESOLVED/FIXED, one question: does that mean that in order to get fixes from the Add-on SDK, Jetpacks extension have to be repackaged and redelivered? Isn't the SDK part of Firefox?

I would have expected that this should have been fixed in BugzillaJS just by a fixed Firefox. (That's one goal of Jetpack: lowering the maintenance burden of extensions' authors)

Or maybe was it before the AO SDK wasn't yet to 1.0 ?
Thanks for the confirmation, teoli2003!
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Reporter)

Comment 6

6 years ago
Unfortunately, I still noticed one bmo zombie. Far less than before, but I still see one while typing this now (since a couple of hours, and lots of GC/GC+CC/Memory pressure). I disabled BugzillaJS, did a GC+CC and it disappeared at once.

But it is far better than with 1.2.1 where I got far more zombies (almost 100%, though I didn't checked precisely).

Also note that this is the only zombie that I have. I also see the 37 system compartments created by BugzillaJS (I think this is bug 672443 ) going away if I disable the extension.

Comment 7

6 years ago
If you're typing a comment in Bugzilla, your Bugzilla compartment isn't zombie...
(Reporter)

Comment 8

6 years ago
Of course! I didn't count the one I was typing in. :-)

I'll watch some more if the zombie reappears (it didn't have). If so, I'll report back. 

1.2.2 is definitively an improvement.
I think any bugs involving memory are probably the fault of the SDK, and not my add-on specifically.  My add-on is pretty much a straight page_mod, so the SDK and Firefox should have no problem cleaning up after it.
Assignee: general → poirot.alex
(Assignee)

Comment 10

6 years ago
Gregory: You are right, your addon isn't doing anything special that may lead to a zombie compartment. If there is one, it will be SDK fault!

Having said that, Is this issue still alive?
bugzilla js available here (http://gkoberger.net/bugzillajs/index.html) is built using SDK 1.0b6pre, a very old SDK version.
And the one available on AMO uses 1.3a0, a more recent one.
Please consider rebuilding it using very last 1.4 release.
(No, the SDK is not included in Firefox, you have to rebuild your addon on a regular basis. AMO sometime do this for you automatically)
Alexandre, I haven't seen any issues lately. That URL is out of date, so look at the AMO version of it[1]. I keep the SDK repo up to date, so the versions I upload to AMO are always using the latest.

1. https://addons.mozilla.org/en-US/firefox/addon/bugzillajs
You need to log in before you can comment on or make changes to this bug.