The author wrote a really short code snippet that demonstrates the problem:
function f() {
var some = [];
while(some.length < 1e6) {
some.push(some.length);
}
function g() { some; } //removing this fixes a massive memory leak
return function() {}; //or removing this
}
If you keep a reference to the results of calling this function, it will keep a reference to the "some" variable, even though it is not needed.
He created a page that demonstrates the problem here:
Comments
The author wrote a really short code snippet that demonstrates the problem:
If you keep a reference to the results of calling this function, it will keep a reference to the "some" variable, even though it is not needed.He created a page that demonstrates the problem here:
https://s3.amazonaws.com/chromebugs/memory.html
So well that it crashed/froze icweasel...