# Uncaught RangeError: Array buffer allocation failed

**URL:** <https://forums.unrealengine.com/t/uncaught-rangeerror-array-buffer-allocation-failed/383780>\
**Category:** Platform & Builds\
**Tags:** HTML5, packaged-build, unreal-engine, Packaging, packaging-projects, package-error, question\
**Created:** [February 2, 2017, 11:38pm UTC](https://forums.unrealengine.com/t/uncaught-rangeerror-array-buffer-allocation-failed/383780 "2017-02-02T23:38:37Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_5be95aeb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5be95aeb](https://forums.unrealengine.com/u/anonymous_user_5be95aeb)\
**Post date:** [February 2, 2017, 11:38pm UTC](https://forums.unrealengine.com/t/uncaught-rangeerror-array-buffer-allocation-failed/383780/1 "2017-02-02T23:38:37Z")

</div>

Hi I managed to get it to pack for HTML5. When I run Chrome or Nightly the bar completes but then it shows the error “Uncaught RangeError: Array buffer allocation failed” and it keeps compiling.I had increased the HEAP size in the project settings \> HTML5

also in HTMLEngine.ini and still nothing changes

How can I fix this?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5be95aeb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5be95aeb](https://forums.unrealengine.com/u/anonymous_user_5be95aeb)\
**Post date:** [February 2, 2017, 11:40pm UTC](https://forums.unrealengine.com/t/uncaught-rangeerror-array-buffer-allocation-failed/383780/2 "2017-02-02T23:40:06Z")

</div>

When I try to launch it within the program on Nightly or Chrome it says “Unable to connet” on the browser without any errors on the output log

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5be95aeb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5be95aeb](https://forums.unrealengine.com/u/anonymous_user_5be95aeb)\
**Post date:** [February 3, 2017, 12:07am UTC](https://forums.unrealengine.com/t/uncaught-rangeerror-array-buffer-allocation-failed/383780/3 "2017-02-03T00:07:08Z")

</div>

This is exactly what it shows

 ![124734-memory.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/6/3/6634929a3e3721648f93f827294c26f1aa4269e3.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5be95aeb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5be95aeb](https://forums.unrealengine.com/u/anonymous_user_5be95aeb)\
**Post date:** [February 3, 2017, 12:30am UTC](https://forums.unrealengine.com/t/uncaught-rangeerror-array-buffer-allocation-failed/383780/4 "2017-02-03T00:30:35Z")

</div>

This is the other error. This one shows up after I packaged and I run it through a local server on Firefox Nightly.

 ![124735-uncaught.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/d/c/0dcfe43d0f1eeee2fff39c18cd56b3881e2717f5.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5be95aeb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5be95aeb](https://forums.unrealengine.com/u/anonymous_user_5be95aeb)\
**Post date:** [February 3, 2017, 1:35am UTC](https://forums.unrealengine.com/t/uncaught-rangeerror-array-buffer-allocation-failed/383780/5 "2017-02-03T01:35:45Z")

</div>

I had increased the HEAP size in the project settings \> HTML5

also in HTMLEngine.ini and still nothing changes

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5be95aeb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5be95aeb](https://forums.unrealengine.com/u/anonymous_user_5be95aeb)\
**Post date:** [February 3, 2017, 3:34am UTC](https://forums.unrealengine.com/t/uncaught-rangeerror-array-buffer-allocation-failed/383780/6 "2017-02-03T03:34:33Z")

</div>

Attached is my loglink text

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_62063234](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_62063234](https://forums.unrealengine.com/u/anonymous_user_62063234)\
**Post date:** [February 3, 2017, 4:26pm UTC](https://forums.unrealengine.com/t/uncaught-rangeerror-array-buffer-allocation-failed/383780/7 "2017-02-03T16:26:47Z")

</div>

How big of a heap did you try? Does it still do this with a 2GB heap size?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5be95aeb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5be95aeb](https://forums.unrealengine.com/u/anonymous_user_5be95aeb)\
**Post date:** [February 3, 2017, 4:30pm UTC](https://forums.unrealengine.com/t/uncaught-rangeerror-array-buffer-allocation-failed/383780/8 "2017-02-03T16:30:14Z")

</div>

Unreal won’t let me change the heap side to more than 4096. I did try 2000mb on unreal and still same error Also, in the output log error towards the end it shows python.exe file size is 294mb may cause error in browsers.

I got the starter packaged to work in the browsers. But my project won’t work. How do I decrease the size of the package?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5be95aeb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5be95aeb](https://forums.unrealengine.com/u/anonymous_user_5be95aeb)\
**Post date:** [February 3, 2017, 4:33pm UTC](https://forums.unrealengine.com/t/uncaught-rangeerror-array-buffer-allocation-failed/383780/9 "2017-02-03T16:33:05Z")

</div>

I also have compressed cooked content selected. If its not ticket the game exceeds 800mb

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5be95aeb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5be95aeb](https://forums.unrealengine.com/u/anonymous_user_5be95aeb)\
**Post date:** [February 3, 2017, 6:03pm UTC](https://forums.unrealengine.com/t/uncaught-rangeerror-array-buffer-allocation-failed/383780/10 "2017-02-03T18:03:18Z")

</div>

Please see attached for browser log

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f0fea7ad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f0fea7ad](https://forums.unrealengine.com/u/anonymous_user_f0fea7ad)\
**Post date:** [February 9, 2017, 7:35am UTC](https://forums.unrealengine.com/t/uncaught-rangeerror-array-buffer-allocation-failed/383780/11 "2017-02-09T07:35:05Z")

</div>

The maximum heap size you can try is 2048MB - 16MB = 2032MB. Browsers currently don’t support allocating anything larger than that.

If you are running on a 32-bit browser, a HEAP size of 512MB or 768MB is about the maximum that is possible.

In the current version of UE4 the amount of assets you have on disk contributes to this limit, so reducing the number of assets on disk can help here. In a later UE4 version I believe this should no longer be the case.

With upcoming WebAssembly spec, these types of errors should hopefully be avoided in the future: [A WebAssembly Milestone: Experimental Support in Multiple Browsers - Mozilla Hacks - the Web developer blog](https://hacks.mozilla.org/2016/03/a-webassembly-milestone/), though unfortunately that feature is not quite yet out of the door in browsers.
