Search Unity

Can't make a webassembly build with memory heap larger than 512 mb

Discussion in 'Web' started by kognito1, May 22, 2017.

  1. kognito1

    kognito1

    Joined:
    Apr 7, 2015
    Posts:
    331
    Hello,

    So for our automated regression tests, we allocate 1 gb of memory on the heap since some of our really long replays take quite a bit more memory than our "normal application" (we test memory regressions separately). Now I know we can't just override memory from javascript for webassembly (it's baked into the webassembly binary), but even when I build an empty scene with the heap size set to more than 512 mb (I've tried 640, 768, 1024, 1023, etc.) I get this error in chrome (the numbers will be slightly different depending on what heap size I set):

    And on Firefox:
    Is this the expected behavior? Are there "special heap size values" for webassembly that I just don't know? The "javascript versions" (i.e. if we turn off webassembly) work fine with those heap sizes set.
     
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    It's not really expected.
    Is this on 64bit Chrome? Have you tried Canary?
     
  3. kognito1

    kognito1

    Joined:
    Apr 7, 2015
    Posts:
    331
    Whoops this one is on me. I misunderstood and thought "TOTAL_MEMORY" override was ignored for webassembly. Turns out it's not ignored! The override just doesn't work when it's mismatched to whatever was set when the webassembly binary was built. Sorry about that! :oops: