Search Unity

Question InitializationObjectsOperation persists in Profiler

Discussion in 'Addressables' started by karlenevalmonte, Apr 20, 2021.

  1. karlenevalmonte

    karlenevalmonte

    Joined:
    Nov 15, 2015
    Posts:
    2
    Doing some tests using Addressables and I noticed that the InitializationObjectsOperation won't leave the profiler? I instantiate two addressable assets then release them and go back to an empty scene (which is not an addressable asset) The reference count for my instantiated objects turns zero and eventually disappears from the profiler but the InitializationObjectsOperation still has a ref count of 1 and doesn't leave the profiler ever (unless I press clear). Although when I do go back to the scene where it instantiates two addressable assets, its ref count is still 1 and doesn't increase. Anyone has an idea what this operation does?

    Annotation 2021-04-20 194838.png
     
    Last edited: Jun 15, 2021
  2. xjjon

    xjjon

    Joined:
    Apr 15, 2016
    Posts:
    613
    Did you ever figure this out?

    Noticed the same thing in my project
     
  3. karlenevalmonte

    karlenevalmonte

    Joined:
    Nov 15, 2015
    Posts:
    2
    Haven't figured this out :( We just left it as it is since it doesn't increment anyway.
     
  4. xjjon

    xjjon

    Joined:
    Apr 15, 2016
    Posts:
    613
    Yeah.. it is annoying..

    Here is the code to reproduce if anyone at Unity can look at it:

    Create this component, add it to game object. Add any addressable sprite to it.
    You will see the event viewer has a lingering InitializationObjectsOperation even after everything has been released.

    Reproduced it in 2019.3 LTS (1.8.5) and 2020.3 LTS (1.13.1)

    Code (CSharp):
    1. public class AddressableTester : MonoBehaviour
    2. {
    3.     public AssetReferenceSprite SpriteToLoad;
    4.     void Start()
    5.     {
    6.         var handle = SpriteToLoad.LoadAssetAsync();
    7.         handle.Completed += operationHandle =>
    8.         {
    9.             Addressables.Release(handle);
    10.         };
    11.     }
    12. }
    upload_2021-6-15_9-58-52.png
     
  5. msnz

    msnz

    Joined:
    Nov 4, 2020
    Posts:
    31
    I'm having the same issue on 2020.3.16f...
     
  6. Mukaujoka

    Mukaujoka

    Joined:
    Mar 17, 2017
    Posts:
    17
    I'll just go ahead and bump this thread as I just noticed the same issue in my project and I don't know where it is coming from and how to get rid of it (it does not appear when testing in the editor, this was with a build).
     
  7. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
    Hi all thanks for reporting this issue. InitializationObjectsOperation is an operation that is run when Addressables is initialized. It looks it is not being cleaned up properly. Will create a bug ticket
     
  8. LightRuno

    LightRuno

    Joined:
    May 2, 2018
    Posts:
    8
    Still persists on 2021.3.11f1 LTS. Bump.
    Having issues on same thing as code to reproduce above: Just load loading asset while Start() at starting playmode.
    When I unload an asset and load it later - it throws me
    Attempting to load AssetReference that has already been loaded. Handle is exposed through getter OperationHandle

    While other assets that are loading by exactly same method are ok to unload + load.