Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Other than creating countless groups, is there way to clean unused memory?

Discussion in 'Addressables' started by codingSince666, Oct 28, 2021.

  1. codingSince666

    codingSince666

    Joined:
    Oct 21, 2021
    Posts:
    16
    My problem with groups is that its based on the idea of grouping related items together, so that the whole group will free memory when every element of that group gets destroyed

    this is terrible for eg items. lets say i have a helmet and an armor.

    or lets say i have 100 helmets and 100 armors.
    100 helmets and 99 armors can be unloaded, but you will not be able to clean memory for any of them, because one of them is still loaded.

    thats cause theyre all part of the same group.


    but in this case id have to create 200 groups for armors and helmets alone.
    not only is this unscalable, its probably slow and a poor choice overall


    is there any other way? i want to be able to clean/free memory of models that i no longer use
     
  2. LilMako17

    LilMako17

    Joined:
    Apr 10, 2019
    Posts:
    43
    I am also curious if anyone has any good ideas on this. (I've run into the same problem). My current solution is to mark some groups as "pack separately" so each prefab ends up in it's own asset bundle. However, if you have any shared textures, they will be duplicated across multiple bundles in this model, unless you go flag each dependency texture individually and also put them in an addressables group somewhere.
     
  3. codingSince666

    codingSince666

    Joined:
    Oct 21, 2021
    Posts:
    16
    even with pack separately, as far as i know, you still need to destroy/unload all objs from given group before it frees memory