Opened 8 years ago

Closed 7 years ago

#13563 closed defect (fixed)

symbol build option causes memory leak on IE

Reported by: Rawld Gill Owned by: Rawld Gill
Priority: low Milestone: 1.8
Component: BuildSystem Version: 1.6.1
Keywords: needsreview Cc: Bryan Forbes, liucougar
Blocked By: Blocking:

Description

The functionality in #13352 introduces named function expressions (NFEs) which cause memory leaks on IE (see http://kangax.github.com/nfe/). A named function expression looks like this:

var f = function g(){};

In IE, this will actually create two different functions and assign one to "f" and one to "g". Since they both reference each other through a closure, IE won't garbage collect them. In order for IE to garbage collect them, you have to null out the "named" function:

var f = function g(){};
var g = null;

The leaks are cleared up when the browser refreshes or you close the browser, but this is still a leak on single-page applications since you can't reclaim the memory except by navigating away from the page.

This feature is opt-in and would likely *not* be used for released code. Also, the implementation of this feature did not change in 1.7 compared to prior versions.

Change History (4)

comment:1 Changed 8 years ago by Rawld Gill

Owner: set to Rawld Gill
Status: newassigned

comment:2 Changed 8 years ago by bill

Component: GeneralBuildSystem

comment:3 Changed 7 years ago by ben hockey

Keywords: needsreview added

i'm wondering if we shouldn't just add some kind of log message during a build to warn developers of this problem and then close this ticket. i'm not sure there's anything we can do to fix it.

comment:4 Changed 7 years ago by Rawld Gill

Resolution: fixed
Status: assignedclosed

In [29192]:

added warning about leaks on IE when building with symbols; fixes #13563; !strict

Note: See TracTickets for help on using tickets.