Search Unity

Is there a memory leak or something when i load textasset from AssetBundle

Discussion in 'Asset Bundles' started by zyonghao, Nov 10, 2020.

  1. zyonghao

    zyonghao

    Joined:
    Aug 2, 2019
    Posts:
    5
    1.The project compression method is "LZ4"
    2.There are some different assetbundles in streamingasset,"storyconfig1" is small asset,contains a JSON text of 3M size,"storyconfig","ccc" and "ccc1" is big asset,contains json text of 18M size
    3.Here is the test interface I used to read the different configurations TestMono1.png
    My question is when I read 3M text from the Bundle, I can reclaim Mono memory, but not 18M.
    Is my Unload method incorrect?

    Unity version is 2018.4.10
     

    Attached Files:

  2. zyonghao

    zyonghao

    Joined:
    Aug 2, 2019
    Posts:
    5
    I can recycle the Mono memory added by reading 18MTextAsset if the compressed format is the default, although there are other issues such as the memory cannot be freed clean after repeated reads.
     
  3. zyonghao

    zyonghao

    Joined:
    Aug 2, 2019
    Posts:
    5
    I've seen different performance on different phones, and in my tests on the MotoG5, the memory leak was worse than on other devices