Search Unity

emscripten fails with "Allocation failed - process out of memory" with "fastest" optimization build

Discussion in 'Web' started by tayl0r, Mar 17, 2015.

  1. tayl0r

    tayl0r

    Joined:
    Jan 6, 2012
    Posts:
    85
    This is a continuation of this Unity5 beta forum thread: http://forum.unity3d.com/threads/unity-5-beta-14-webgl-error.282998/

    Since the last post there (a few months ago), we went back to Webplayer plugin and only recently started working on the webGL build again since Unity5 is out and more stable. But I'm sorry to report that we're still getting this with the Unity5 patch release 1 version (5.0.0p1).

    @jonas echterhoff - I created a new bug report with our updated project (bug #681579). The last time, you said the problem was probably caused by a several thousand line long method but didn't explicitly call out which method it was. Using the CPP output from a Unity 5.0.0p1 build, we ran it though a static analysis tool and the longest method is TextMeshPro_GenerateTextMesh, from the TextMeshPro plugin.

    So, I created a new empty project, imported TextMeshPro plugin, and tried the webGL build with the same settings. It worked. So, it might be a different method or there is something else going on.

    Is there any way we can get more visibility into what method it's optimizing when the emscripten crash happens? Any other ideas on how we can track this down?
     
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Unity 5.1 will update to a new version of emscripten with a rewritten JS optimizer which does not have this issue.

    Until then maybe, the easiest workaround is to build in "Fast" instead of "Fastest" (in reality, the performance benefit of "Fastest" over "Fast" is pretty small - but the difference in build time is huge, so in many cases "Fast" is probably the better option anyways).
     
  3. tayl0r

    tayl0r

    Joined:
    Jan 6, 2012
    Posts:
    85
    Cool, thanks Jonas!