I have set the memory limit to 128K using the following code:
JS_SetMemoryLimit(rt, 128*1024);
I expected the following script to generate an exception after 13
iterations. However, it takes 326 iterations to generate out of memory
exception.
var a = [];
for(var i=0; i < 1000; i++) {
print(i);
a[i] = new Array(10000);
}
Can someone explain what am I doing wrong?