Check out the following javascript. I would think that allocating in a loop would allow garbage collection, preventing heap overflows. It does this correctly in Firefox, however in Chrome (tested on OSX) the fragment resets the open tab after several iterations.
for (var i = 0; i < 1024; ++i) {
var buffer = new Float32Array(1024*1024*4);
delete buffer;
buffer = null;
console.log(i);
}
This script alone is not all that useful. But I'm trying to optimize my Javascript application to use less memory. Therefore, I would like to receive your opinion. Is this a bug in Chrome? Do you know about workarounds to explicitly cause garbage collection during code execution (in FF and IE they seem to exist)? Thank!
: Chrome Inspector " ". 7- " " . , GC Javascript? , , Javascript?