Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Memory Size field in WEBGL Player settings missing

Discussion in 'Editor & General Support' started by Leucaruth, Apr 18, 2019.

  1. Leucaruth

    Leucaruth

    Joined:
    Mar 7, 2014
    Posts:
    7
    Hi, i wanted to try unity 2019 with a little webgl project that I was asked and couldnt find the field Memory Size in the publishing settings, is this a bug? in the documentation it says its where it always was...

    BUG.png
     
  2. Claudioa

    Claudioa

    Joined:
    Dec 9, 2015
    Posts:
    17
    I'm facing the same problem, did you manage to solve it?
     
  3. Binary42

    Binary42

    Joined:
    Aug 15, 2013
    Posts:
    207
    "WebGL
    With this release, WebAssembly is the default output format for Unity WebGL. In addition, asm.js has been removed from the Editor UI, which was deprecated in 2018.3. To reflect these changes, the asm.js-specific Use PreBuilt Engine build option is no longer available. WebGL Player Settings have also been updated: Linker Target and Memory Size are set to WebGLLinkerTarget.Wasm and 32MB respectively, and they have been removed from the Editor UI. However, it is still possible to modify these settings via the Editor script.

    In this release, we also introduce experimental WebAssembly multithreading, which can be enabled via PlayerSettings.WebGL.threadsSupport. See this forum post for more information."

    https://blogs.unity3d.com/2019/04/16/introducing-unity-2019-1/
     
  4. Magendanz

    Magendanz

    Joined:
    Sep 8, 2015
    Posts:
    6
    This has become a huge issue for my students learning game development with the 2D and 3D Game Kits. The size of the kits require raising TOTAL_MEMORY to avoid an Out of Memory error on the browser, but the UI setting is now gone. The workaround is to edit the .json file with a text editor, which has proven to difficult for students first exposed to Unity development in an intro course pitched as zero-code. What possessed Unity to remove this setting?

    BTW, you can save a preset and manually edit the webGLMemorySize property. I currently have the students download this custom preset and add it to their projects, then select it in Player Settings. It also includes some other things, like removing WebGL 1.0 from Graphics APIs and enabling WebAssembly Streaming.
     
    Last edited: Nov 30, 2020
  5. benhall98

    benhall98

    Joined:
    May 26, 2020
    Posts:
    4
    How do you edit that property in the .HTML file? Do you have an example? I'm really stuck:(
     
  6. unity_IdafozNQgkAPGA

    unity_IdafozNQgkAPGA

    Joined:
    Apr 3, 2020
    Posts:
    1
    After building your game, in the output directory open ./Build/YourProjectName.json using your code editor and change the "TOTAL_MEMORY" property to a bigger number (it represents the total size of the Unity Heap in bytes, allocated in the browser). Try to keep this number as low as possible though, as the browser limits your total available memory and I do think it is browser-dependent.

    Taken from the docs:
     
  7. TOES

    TOES

    Joined:
    Jun 23, 2017
    Posts:
    134
    What are you talking about? Unity is managing this automatically now.
     
  8. notagame

    notagame

    Joined:
    Sep 17, 2017
    Posts:
    17
    No it doesn't. It runs out of memory pretty quickly. Whatever they are doing, its not working reliably. But I would expect nothing less anyways xD.
     
  9. Alejandro-Martinez-Chacin

    Alejandro-Martinez-Chacin

    Joined:
    Oct 15, 2013
    Posts:
    144
    I'm still a bit lost on this, none of the files inside the "Build" folder are .json.
    I got:
    • [Game].data.gz
    • [Game].framework.js.gz
    • [Game].loader.js (this one could be it but it didn't have anything related to "TOTAL_MEMORY"
    • [Game].wasm.gz
    Extracting some of those GZip weren't fruitful either.
     
    travlake and Moritzfx like this.
  10. UnityProdS

    UnityProdS

    Joined:
    Jan 11, 2014
    Posts:
    40
    Same situation here. For some reason, it's very difficult to find a way to change the total memory to be allocated for WebGL builds. With newer versions of Unity coming out the output files of Webgl exports are changing. Plenty of resources online which tell you how to optimize WebGL builds but none show how to increase the memory size.
     
    Moritzfx likes this.
  11. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    228
    PlayerSettings.WebGL.memorySize
    "This setting has been deprecated and does not have any effect on WebAssembly builds."

    Unity 2021 LTS

    My WebGL build crashes when uploading large GIF files ("RuntimeError: memory access out of bounds").
    Previousely, I was able to fix this by setting WebGL Memory Size.

    What should I do now? The output folder doesn't contain any json files where I could find "TOTAL_MEMORY" =(((((