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 Array.splice() #3035
Comments
Exploring a bit further it seems the problem gravitates around removing the final entry in an array. The following examples supports it:
|
We are experiencing a memory leak in our web application as of IE v11.0.42. We have a strong feeling it's related to this bug. Any idea yet when this would be solved in IE 11? Are there certain ways to avoid/lower the impact of the issue? IE settings, alternatives, ... |
Thanks for the feedback. Our plan is to have the fix in our next release (Windows 10 Update). I will let you know if a work-around is available. |
Thanks for the fast response! Are we talking about weeks/months/half a year? What about IE 11 on Windows 7/8? |
Unfortunately, only security fixes will be made (monthly) for IE11 on Windows 7/8, which is not applicable here. Looks like only next Windows 10 Update will have the fix. As @ChristianStroyer mentioned, one work-around is to set the array entry to null before using splice() to remove those entries; another work-around is to start with index 1. |
Fixing IE leak and Edge leak: Here is the workaround we use in our project. It's a so called shim which overrides the existing Try it on https://jsfiddle.net/aefxf0v9/6/
|
In some cases an object removed from an array with
Array.splice
is still allocated in memory, even though it is not seen in a heap dump. This results in IE(11.0.42) and Edge(38.14393) running out of memory in Windows in our web app. Chrome(58) does not have this issue.Array.splice is a common way to remove entries in arrays. If it leaks I believe it is a huge issue for Edge.
I've created a small example. It creates an array with a large objects, and then removes the object with
splice(0,1)
. Running this for a few seconds takes both IE and Edge to a memory consumption of more than 1GB, which is never freed. An inspection shows only empty arrays.Example at https://jsfiddle.net/aefxf0v9/
Setting the array entry to null before removing it with splice fixes the problem. I have made a shim for our project, but would very much like to see a solution.
The text was updated successfully, but these errors were encountered: