Skip to content

Instantly share code, notes, and snippets.

@spirinvladimir
Created February 12, 2019 06:31
Show Gist options
  • Save spirinvladimir/99b436d1e93d1734366b4b2ba3df22dd to your computer and use it in GitHub Desktop.
Save spirinvladimir/99b436d1e93d1734366b4b2ba3df22dd to your computer and use it in GitHub Desktop.
Max memory allocation at browser
var i = 0;
var bigest = (bytes) => {
console.log(i++, bytes);
try {
return new ArrayBuffer(bytes)
} catch (e) {
return bigest(bytes / 2)
}
}
var ab = bigest(Math.pow(2, 30) * navigator.deviceMemory)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment