Created
February 12, 2019 06:31
-
-
Save spirinvladimir/99b436d1e93d1734366b4b2ba3df22dd to your computer and use it in GitHub Desktop.
Max memory allocation at browser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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