I have created a JSFiddle to see how much data I can push into my browser.
The link is http://jsfiddle.net/GWxAk/
The code is simple. It’s just trying to push as many strings as possible into an array.
The strings have an approximate length of 300-310 characters.
My question is:
does the result depend on how much memory I have got on my PC ?
does it really differ browser to browser ?
For instance if I have 8gb of ram will I get much more then if I have 4gb ?
var s = '';
for (var i = 0; i < 300; i++) {
s += 'a';
}
array = [];
count = 0;
function doMore() {
for (var i = 0; i < 1000; i++) {
count++;
array.push(s + count);
}
};
function repeat() {
doMore();
document.body.innerHTML = 'size:' + array.length;
setTimeout(repeat, 100);
}
repeat();
In my case chrome hangs at 14850000 and I have 4gb of ram
That is an array of almost 15 million items. Not bad I guess
Do you guys get the same ?
Can somebody tell how to give as much memory as possible to the browser
Thanks
Again, my machine with 16GB of RAM. I can watch the browser RAM usage climb as it increases, so I would assume it’s limited by RAM as well.
Here is a screenshot of memory usage and firefox http://screencast.com/t/3Xl31yGgHWC