HTML5 Mobile Browsers Out of Memory (UE 4.10.4)

Hi,

I’m producing HTML5 output from UE 4.10.4 (has to be this version, as I’ve been unsuccessful in producing functional output in later versions – this appears to be due to emscripten issues). This works without issue when accessing the content (served from the web) via desktop browser. If, however, it’s accessed from Chrome or Safari on iOS, i get “Error: Out of memory”.

132460-out+of+memory.jpg

If accessed from Chrome on Android, I get “Uncaught RangeError: Array buffer allocation failed”.

132481-uncaught+rangeerror.jpg

Heap size has been tried at 1024, 2048, & 4096, with the same results.

One thing to note is that this is NOT the “uncaught exception: out of memory” error described in some of the other threads:

132483-uncaught+exception.jpg

So, my question is was this a known issue with 4.10.4, and if so, were there any solutions or workarounds? Ultimately, I’d like to migrate the project up to 4.15+, but until I can find one that produces functional HTML5 output with my custom C++/emscripten/javascript communication, I’m stuck here.

Cheers!

just wondering – why not package for native iOS or android?

on a side note: i have done no testing for mobile browsers (since they are usually very behind to the desktop browsers.)

because the game engine runs natively on those mobile devices and most browser makers are only supporting bleeding edge features on desktop browsers (e.g. asm.js [back then] and wasm [now]) - there are no plans for bringing UE4 on HTML5 for mobile browsers…

(this may change in the future when wasm becomes supported on mobile browsers – but as of right now, i haven’t heard from apple, google or microsoft doing anything like this for mobile…)

The out of memory error is actually coming from the heap allocation itself, so making the heap size larger makes it run even more out of memory and not the other way around. Try reducing the heap size to e.g. 256MB or 384MB for mobile. Also try out Firefox or Chrome browsers on mobile, those are the only browsers that at the moment ship WebAssembly support. UE 4.16 is planned to have WebAssembly as well. I believe current UE4 Github master branch has WebAssembly as well.

There is probably no way to get UE4 size codebases to work on current Safari on iOS with the current pre-WebAssembly asm.js, unless perhaps if running tiny projects, since the mobile Safari browser has not been optimized for asm.js at all. Once WebAssembly lands to Safari on iOS, success rates should be dramatically better. Current nightly WebKit builds on desktop already have WebAssembly support, so they are working on it, but unfortunately there is no release schedule yet. If you do want to try before that, check by using desktop Firefox and Chrome browsers to profile memory usage first, and see if you can squeeze the web page to under 300-400MB or so.

Hello dmultimediab,

Was juj’s answer able to help you resolve this issue? If not, please let us know what you’ve tried. In the meantime, I’ll be marking this issue as resolved for tracking purposes.

Unfortunately, no, juj’s answer didn’t solve the issue. With the heap set to 256MB, the error occurs exactly the same as before, in Chrome, Safari and Firefox.

The content has to be served and tracked via a learning management system, and therefore has to be HTML5 and accessed through a browser. For what it’s worth, please consider this an emphatic vote for support of UE4 on HTML5 in mobile browsers.

Thanks!

Hi, now that it’s August 2019, and with UE4.22 I am still running into this issue. I just packaged HTML5 shipping on a small test scene, and the shipping package is only 95MB in size. On my IPhone X, it still said out of memory.

I am wondering if any progress has been made in terms of getting HTML5 working on mobile.

Dear Mantracker. I have just finished 4.24 HTML engine build. PC, it starts perfectly fine. iOS safari, chrome, it doesn’t show anythiing.

I am using this script for start up on PC. This facilitates the lauch on web otherwise I gets series of errors.

However, I failed to see the any errors on the iOS webbrowsers.