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

Browser's process memory continues to increase when creating a large number of DOM elements #3603

Closed
pmgmendes opened this Issue Apr 1, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@pmgmendes

pmgmendes commented Apr 1, 2017

Description

What do you expect to happen?
append() method usage should allow the browser to successfully garbage collect any of the child elements created.

What actually happens?
Chrome's tab process memory is not being freed. The memory continues going up until the tab crashes.

Which browsers are affected?
Chrome current stable 57.0.2987.133, current beta 58.0.3029.41-1 and current unstable 59.0.3053.3-1

There's is also a reported Chromium bug.
Process memory continues to increase when recycling a large number of DOM elements

Link to test case

https://jsfiddle.net/pmendes/wLu6kj1b/

@mickmcgrath13

This comment has been minimized.

Show comment
Hide comment
@mickmcgrath13

mickmcgrath13 Apr 5, 2017

FWIW:

Here is a very small non-jQuery example that leaks like crazy in Chrome 57 but is stable in 56:
http://jsbin.com/bihuca/1/edit?html,js,output

The key is the line elem.getElementsByTagName('script' || '*');. Removing that gets rid of the leak.

The jQuery path through this is:

append:5924
domManip:5732
buildFragment:4834
getAll:4732

This information has also been added to the related chromium bug

mickmcgrath13 commented Apr 5, 2017

FWIW:

Here is a very small non-jQuery example that leaks like crazy in Chrome 57 but is stable in 56:
http://jsbin.com/bihuca/1/edit?html,js,output

The key is the line elem.getElementsByTagName('script' || '*');. Removing that gets rid of the leak.

The jQuery path through this is:

append:5924
domManip:5732
buildFragment:4834
getAll:4732

This information has also been added to the related chromium bug

@timmywil timmywil removed the Needs review label Apr 10, 2017

@timmywil timmywil added this to the 3.3.0 milestone Apr 10, 2017

@mickmcgrath13

This comment has been minimized.

Show comment
Hide comment
@mickmcgrath13

mickmcgrath13 commented Apr 12, 2017

Looks like this is getting fixed on the Chrome side: https://bugs.chromium.org/p/chromium/issues/detail?id=707544#c35

@pmgmendes

This comment has been minimized.

Show comment
Hide comment
@pmgmendes

pmgmendes Apr 12, 2017

Being a specific Chrome issue and being solved there I guess it makes sense to close this issue, right?

pmgmendes commented Apr 12, 2017

Being a specific Chrome issue and being solved there I guess it makes sense to close this issue, right?

@timmywil

This comment has been minimized.

Show comment
Hide comment
@timmywil

timmywil Apr 13, 2017

Member

@pmgmendes Agreed. I don't see a workaround on our end anyway.

Member

timmywil commented Apr 13, 2017

@pmgmendes Agreed. I don't see a workaround on our end anyway.

@timmywil timmywil closed this Apr 13, 2017

@lock lock bot locked as resolved and limited conversation to collaborators Jun 18, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.