Search Unity

Question CCD+Addressables Size Limit in WebGL on Chromium Browsers

Discussion in 'Web' started by Jmangles, Sep 15, 2021.

  1. Jmangles

    Jmangles

    Joined:
    Aug 1, 2015
    Posts:
    53
    I'm having an issue where on any Chromium based browser like Edge/Chrome/Vivaldi, when our player attempts to download a 200MB asset bundle from CCD it fails completely and crashes out of the player. It does not happen immediately either, it will download for a bit before failing.

    This is not an issue in Firefox. I'm wondering if this is a memory provisioning limit for these browsers, if there's a setting I can change, or if it's a bug.

    I can reduce lightmap resolution and things of that nature if there's a hard memory limit.

    Edit: It appears all Chrome based browsers will hit 255MB downloaded before crashing out, could just be a coincidence but having the max size the player can download be exactly the max value of a byte seems like it's a hard limit. I don't know if breaking up the content into separate bundles would fix the issue in this case since 255MB is already across multiple bundles and the player itself.

    Everyone I've gotten to test this out on Chrome crashes out at 255MB but it works fine on their Firefox.
     
    Last edited: Sep 15, 2021
  2. Jmangles

    Jmangles

    Joined:
    Aug 1, 2015
    Posts:
    53
    Did some further testing and found that 255MB was a pure coincidence, after reducing the total size of player + bundles to 170MB it still failed to load on Chromium-based browsers. Firefox is still fine.

    Edit:
    Some testers found that smaller asset bundles would fail to load on their machines. The largest (110MB) asset bundle would fail to load on everyone's machine but smaller ones (60MB) would fail to load on some people's machines.
     
    Last edited: Sep 16, 2021
  3. Jmangles

    Jmangles

    Joined:
    Aug 1, 2015
    Posts:
    53
    Just to follow up on this in case someone encounters the same issue, I was able to get the asset bundles to load on Chrome/Edge by disabling Use Asset Bundle Cache on my Addressable Asset Group assets.
    upload_2021-9-16_9-6-24.png

    Extra Testing
    After learning the issue was this cache setting I decided to test the game in a fresh Windows 10 install. I downloaded Chrome on it for the first time and ran the version of the game that still had Use Asset Bundle Cache enabled.
    Even with a fresh install (and thus no existing cached data), the bundle that would not run in Edge/Chrome on anyone's computer still failed to load. It loaded up fine in a fresh Firefox install.
     
  4. Jmangles

    Jmangles

    Joined:
    Aug 1, 2015
    Posts:
    53
    Another odd thing I've noticed is that the version of the game with non-cached asset bundles uses significantly more memory in WebGL for some reason.

    Asset Bundle Cache Disabled:
    upload_2021-9-16_10-48-3.png

    Asset Bundle Cache Enabled:
    upload_2021-9-16_10-48-55.png
     
  5. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
    Hi @Jmangles what Unity and Addresables version is your team using? Also to confirm the player is running on desktop browsers, not mobile?
     
  6. Jmangles

    Jmangles

    Joined:
    Aug 1, 2015
    Posts:
    53
    Currently on Addressables 1.16.19 with Unity 2020.3.2f1, we are only trying to support desktop browsers.
     
  7. Jmangles

    Jmangles

    Joined:
    Aug 1, 2015
    Posts:
    53
    Tested this further by upgrading to 2020.3.18f1 and Addressables 1.18.15, issue is still present if Use Asset Bundle Cache is enabled on all Chromium browsers. Firefox still works fine.
     
    pillakirsten likes this.
  8. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
    Is it possible to reproduce the issue in a smaller project (maybe a new project that just loads one decently-sized AssetBundle)? It would be nice to have a minimal repro that we can use to investigate the issue.
     
  9. Jmangles

    Jmangles

    Joined:
    Aug 1, 2015
    Posts:
    53
    I'll try to reproduce this issue in a new project, if I fail I'll at least write out what steps I tried.
     
    pillakirsten likes this.
  10. Jmangles

    Jmangles

    Joined:
    Aug 1, 2015
    Posts:
    53
    Okay so I played around with a blank project, had it load the remote catalog and download the offending asset bundle from our main project.

    What I've found is that on Chrome/Edge, when pointed to the catalog and asset bundles built with Use Asset Bundle Cache enabled, memory allocations go bananas. On the cache-enabled bundle tests, I was seeing 1.7GB of memory used by Chrome with only the game as its one tab before it settled at ~700MB. This 1.7GB spike was not enough to cause the sad face/crash.

    My next test with cache-disabled bundles showed the memory allocation in Chrome/Edge never exceeded 700MB.

    I believe now the issue is that on the main project we simply run out of memory in Chrome/Edge when Use Asset Bundle Cache is enabled. Checking this out on the main player I see with cache-disabled bundles memory usage is about 1GB while with the cache-enabled bundles we hit 2.5GB before the sad face shows up and all the memory is freed.

    Firefox shows no difference in memory allocation whether the setting is enabled or disabled.

    Edit: Sent in the example project as it very clearly has a large memory spike when it loads the asset bundle from our main project that was built with Use Asset Bundle Cache.
     
    Last edited: Sep 21, 2021
  11. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
    Thank you! We will investigate the issue :)
     
  12. Oreka

    Oreka

    Joined:
    May 22, 2014
    Posts:
    5
    Any updates on this?
     
  13. Jmangles

    Jmangles

    Joined:
    Aug 1, 2015
    Posts:
    53
    There's a ticket in for it and I got an email recently that they were working on it but needed an extra asset bundle from me to test. Been deploying the game without the asset bundle cache in the meantime which hurts a bit more in terms of our CCD bandwidth but what can you do.
     
  14. gboni83

    gboni83

    Joined:
    Jul 5, 2021
    Posts:
    2
    Any updates on this? We are considering using CCD for our new game and most of our players will be playing on WebGL.
     
  15. noamiko313

    noamiko313

    Joined:
    May 14, 2022
    Posts:
    1
     
  16. Jmangles

    Jmangles

    Joined:
    Aug 1, 2015
    Posts:
    53
    Currently it's a ticket here.
     
  17. llunity3d

    llunity3d

    Unity Technologies

    Joined:
    Aug 23, 2021
    Posts:
    24
    Hi, we will investigate further to see what is the status of that ticket

    Thanks!
     
  18. PhilG-Unity

    PhilG-Unity

    Unity Technologies

    Joined:
    Mar 17, 2022
    Posts:
    26
    This thread has been moved to the Platforms > WebGL forum at the request of the CCD Team after discussion with the WebGL team.

    The WebGL platform development team will continue to investigate this issue.