Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

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:
    590
    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:
    590
  5. NoBullIntentions_P

    NoBullIntentions_P

    Joined:
    Jul 2, 2012
    Posts:
    314