Closed Bug 643373 Opened 13 years ago Closed 13 years ago

newChannel might cause leaks in certain instances

Categories

(Core :: Networking, defect)

defect
Not set
major

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: gkw, Unassigned)

References

()

Details

(Keywords: regression)

onLoad : function()
    {
        var ios = Components.classes["@mozilla.org/network/io-service;1"]
                            .getService(Components.interfaces.nsIIOService);
        var menu = document.getElementById("menu_viewAbout");
        var menuitems = menu.getElementsByTagName("menuitem");
        for (var i=0; i < menuitems.length; i++)
        {
            var aboutURL = menuitems[i].value;
            try
            {
                var channel = ios.newChannel(aboutURL,null,null);  // Will throw NS_ERROR_MALFORMED_URI when not available
            }
            catch (e)  // Not valid URL; hide it
            {
                menuitems[i].hidden = true;
            }
        }
    },

This bit of code seems to cause leaks, and Justin Dolske suspects it might be related to the line involving newChannel. He mentions on my blog that "Offhand, I’d suspect that the ios.newChannel() is causing the problem, do we create the page in order to return a channel? Or, less likely, perhaps one/some of those leak if you just create the channel and then GC it"

I’ve noticed that when there is high I/O activity, viewabout.js sometimes throws up a slow JavaScript dialog on startup. Recently, I’ve also noticed that the performance of Firefox 4 Beta / RC seems to slowdown significantly over time as one uses large numbers of tabs (e.g. more than 80) and one would have to restart Firefox. Or disable ViewAbout and the issue seems to go away.

I’ve also experienced lags when opening new windows through JavaScript links with the extension.

ref http://www.rumblingedge.com/2011/03/21/slowdowns-in-firefox-4-beta-rc-when-using-viewabout-2-0/

Note that the extension hasn't been updated in > 1 year and I'm quite sure that this doesn't occur in 3.6.x, so setting it as a regression.
(In reply to comment #0)
> Note that the extension hasn't been updated in > 1 year and I'm quite sure that
> this doesn't occur in 3.6.x, so setting it as a regression.

I mean that snippet of code hasn't changed in the last year or so..
> This bit of code seems to cause leaks

Leaks of what?

> and Justin Dolske suspects

Based on what?

> do we create the page in order to return a channel?

No.

> perhaps one/some of those leak if you just create the channel and then GC it

Not that likely, generally speaking; most channels just hold a ref to the url after you create them.   Again, what's leaking?  What URI is involved?
My comments on your blog were intended as suggestions on where you might start investigating, not that this was likely to be a bug in Firefox. We'd need more concrete findings before we can do much on our end.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.