Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in IE11 #16634

Closed
dwickern opened this issue May 14, 2018 · 12 comments
Closed

Memory leak in IE11 #16634

dwickern opened this issue May 14, 2018 · 12 comments

Comments

@dwickern
Copy link

I'm seeing memory leaks in IE11 after upgrading ember 2.18.2 to 3.1.2. Specifically between versions 3.0.0 and 3.1.0-beta.1.

On ember 3.1.0-beta.1, after ~350 acceptance tests, IE11 memory usage climbs to 2 GB then tests start failing with

Error: Out of memory
   at startRouting (assets/vendor.js:57541:11)
   at startRouting (assets/vendor.js:36654:7)
   at didBecomeReady (assets/vendor.js:37395:11)
   at invoke (assets/vendor.js:34638:17)
   at flush (assets/vendor.js:34558:25)
   at flush (assets/vendor.js:34711:21)
   at end (assets/vendor.js:34844:17)
   at _run (assets/vendor.js:35215:21)
   at run (assets/vendor.js:34902:13)
   at run (assets/vendor.js:51927:5)

On ember 3.0.0, all 450 acceptance tests run and IE11 memory usage is around 1 GB (which is high but not unusual for IE). For comparison, Chrome uses about 450 MB then drops to 200 MB after the tests finish.

My attempt to bisect seems to point to #15828 but there's a big range of commits in there that I can't build and/or run.

@dwickern
Copy link
Author

Reproduction! https://github.com/dwickern/ember-ie11-leak

I just created 1000 acceptance tests:

  for (let i = 0; i < 1000; ++i) {
    test('visiting /foo ' + i, async function(assert) {
      await visit('/foo');

      assert.equal(currentURL(), '/foo');
    });
  }

Here's what happens in IE11:

screen shot 2018-05-14 at 11 53 07 am

And here's after downgrading to ember 3.0.0:

screen shot 2018-05-14 at 11 56 55 am

@rwjblue
Copy link
Member

rwjblue commented May 14, 2018

Haven't had a chance to dig in much yet, but I did capture some memory profiles of the reproduction app. Attaching here (in the hopes that someone has the time to dig in before me 😉 )...

ie11-leak-repro-dump.zip

@MelSumner
Copy link
Contributor

@dwickern what version of Windows & IE11?

@rwjblue
Copy link
Member

rwjblue commented May 15, 2018

My .zip above was from Windows 8.1 with IE 11.0.9600.16384 (from the http://modern.ie VM's).

@rwjblue
Copy link
Member

rwjblue commented May 15, 2018

I re-ran the same tests with ember test --server --environment=production --no-launch --no-live-reload and was able to run through the full test suite without memory growth (took heap snapshots approximately every 100 tests).

This seems to indicate to me that the leak must be related to a debug build specific feature...

@rwjblue
Copy link
Member

rwjblue commented May 15, 2018

As I started digging into what the differences were in debug builds vs prod builds, I noticed that in prod we are not rendering anything (whereas in debug we render the {{welcome-page}} component). Removing that component invocation enables debug builds to pass without memory growth.

This made me attempt to add a very simple component with the same DOM as the welcome-page template which resulted in no memory growth (and all tests completed). The primary difference between this test run and the way the welcome-page addon is setup is that this tested with a normally resolved template whereas the addon imports its layout and reexports it.

After updating ember-welcome-page (locally) to make its template resolved (instead of imported and set as the layout property on the component's JS file), I was able to re-run the test suite without any memory growth.

@rwjblue
Copy link
Member

rwjblue commented May 15, 2018

I just confirmed that the latest beta still demonstrates the memory leak, however latest canary builds do not.

@dwickern
Copy link
Author

I was testing on Windows 7 with IE 11.0.9600.18860

@MelSumner
Copy link
Contributor

MelSumner commented May 15, 2018

There is a known memory leak issue wrt devtools in IE11 that Microsoft has marked as a "won't fix" - they did ship the fix for Edge, though.

@rwjblue
Copy link
Member

rwjblue commented May 16, 2018

I have cherry-picked the following commits into the beta branch:

Prior to these changes the beta branch exhibited the leak with the provided reproduction (in IE11), after these commits there is no leak and the reproduction runs to completion.

@rwjblue
Copy link
Member

rwjblue commented May 16, 2018

Once CI is completed and publishes the beta builds, you should be able to test via:

  • npm i -g ember-source-channel-url
  • ember-source-channel-url beta
  • Update your package.json to specify the URL printed above for ember-source

@rwjblue rwjblue closed this as completed May 16, 2018
@dwickern
Copy link
Author

I can confirm that it's fixed now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants