Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question Out of memory issues on WebGL

Discussion in 'Web' started by liortal, May 21, 2020.

  1. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Our game crashes very often with "out of memory" errors on WebGL.

    Our heap size is 512mb, but we have investigated and found this is likely due to "Memory file system" that requires additional memory (our game downloads many asset bundles at runtime and stores them to "disk" (IndexedDB).

    We are on 2018.4, so changing to UWR and DownloadHandleFile didn't work (there's a bug so it doesn't work - was resolved in 2019.x).

    My question - is there any "magical" solution to help us ?

    For example:
    1. Use somer other file caching mechanism for storing files?
    2. Avoid caching them, and let the browser handle caching internally?
    3. Anything else?
     
  2. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    591
    Can you share the exact error?

    And maybe you can re-patch the bug with UnityWebRequest using .jslib file and override the code.

    Is the "out of memory" related to out of space in the IndexedDB? I guess you can manually clean it.
     
  3. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    What do you mean patch with UWR and jslib ?
     
  4. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    591
  5. NoBullIntentions_P

    NoBullIntentions_P

    Joined:
    Jul 2, 2012
    Posts:
    314