Search Unity

Texture memory not clearing on Oculus Quest / Android?

Discussion in 'Android' started by yaniv_unity392, Feb 16, 2020.

  1. yaniv_unity392

    yaniv_unity392

    Joined:
    Oct 7, 2018
    Posts:
    12
    Hello everyone,
    I have a game that loads a lot of textures from network and clears them up after they are done being used.
    On windows the following code works great to free up texture memory:
    DestroyImmediate(_texturesDict[i_meshName]);
    Resources.UnloadUnusedAssets();

    I verified its being cleared using the memory capture tool.
    The exact same game when runs on Oculus Quest and android piles up a lot of memory and eventually crashes,
    Anyone has any idea who to make sure the texture data will be freed from the gpu?
     
  2. maria_sha

    maria_sha

    Joined:
    Jun 27, 2020
    Posts:
    1
    Hi!
    Do you have any solutions? I have the same problem...
    The only solution I've found is that you should use
    Code (CSharp):
    1. #if UNITY_ANDROID
    2. Destroy()
    3. #elif UNITY_EDITOR
    4. DestroyImmediate()
    5. #endif
    DestroyImmediate() - always ended with crashes, and Destory() works better