Chrome Version: 60.0.3112.78 (64-bit)
OS: Windows 10 Pro (16gb of RAM)
What steps will reproduce the problem?
(1) Open the developer tools console
(2) Evaluate: new Uint8Array(2*1023*1024*1024),new Uint8Array(2*1023*1024*1024),0
What is the expected result?
Chrome allocates two typed arrays and then returns 0. This is very important for us at Figma since we're an emscripten app. We're using memory growth since our users can create variable-sized documents. We want to be able to use as much memory as possible for really big documents but we don't want to always pre-allocate 2gb since then we would use a ton of memory unnecessarily. Memory growth involves growing the emscripten heap by allocating a new larger typed array and copying the old typed array into the new one, so we temporarily need both the old heap and the new heap to coexist.
What happens instead?
The tab crashes. I would really expect it to be possible to allocate two 2gb typed arrays on a 64-bit browser with 16gb of RAM available, but if that's not possible for some reason than it would be great to at least throw an exception in this case instead of crash the tab. Crashing the tab means users who are creating a really large document will lose their work in Figma.
Comment 1 by manoranj...@chromium.org
, Jul 27 2017