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.

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,561
    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:
    566
    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,561
    What do you mean patch with UWR and jslib ?
     
  4. De-Panther

    De-Panther

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

    NoBullIntentions_P

    Joined:
    Jul 2, 2012
    Posts:
    311