Search Unity

Question AssetBundle cached in indexedDB causes memory space

Discussion in 'Asset Bundles' started by noa-devops, Nov 9, 2021.

  1. noa-devops

    noa-devops

    Joined:
    Dec 9, 2020
    Posts:
    1
    I am using UnityWebRequestAssetBundle to download and cache asset bundle files in the IndexedDB(WebGL).
    I have noticed that the asset bundle cached in the indexedDB will cause memory use after reloading the page without any loading process.

    Here is what I have done. Tested with Unity2019,2020,2021, Chome, and Edge.
    1. Create an empty project.
    2. Prepare 5 asset bundle files. Each 100MB
    3. Make a scene to download these files by UnityWebRequestAssetBundle.GetAssetBundle with hash.
    4. Build WebGL build, start a simple server.
    5. Open WebGL build with browser, see the memory consumption is about 200 MB.
    6. Download all asset bundles.
    7. Reload the page, the memory consumption changed to 700MB before loading any asset bundle file.
    8. Open the develop tool, delete all indexedDB files.
    9. Reload the page, the memory consumption returned to about 200MB.

    Addressables use the same UnityWebRequestAssetBundle so there is the same result when I tried Addresables.
    I could not sure if this is a feature or an issue. Has anybody encountered the same problem?

    The attached file is the source code to download asset bundles.
     

    Attached Files: