Javascript maximum size for types?

As you already stated, the specification does not state any size limits / requirements for types besides Number.

So this is definitally left to the implementation.

For example, Chrome’s limit on strings seems to be hard coded at around 512mb (and less on 32bit).

This puts a limit on the maximally
possible allocation request in 32-bit versions of 2^27-1. The maximal flat string
length is ~2^28 (512MB space), and the maximal string length is 2^29-1, so neither of
these limits catch the problem (we would throw an Out-Of-Memory exception instead if
they did).

See: http://code.google.com/p/v8/issues/detail?id=362#c9

As far as the other browsers go, this would need some research e.g. looking into Firefox’s code. But I doubt we can do the same for IE / Opera.

Leave a Comment