Memory leak when instantiating with the new GameObject.InstantiateAsync()

I might make a bug report later, just posting here so I don't forget.

When using GameObject.InstantiateAsync()
9845481--1416861--Unity_CnQHAFgBKg.png
Replace all instances of that code with GameObject.Instantiate()
9845481--1416864--Unity_n5QMzEDdNC.png

This is on Unity 2022.3.29f1, easily reproduceable with large prefabs. I was using this for a prefab chunk streaming system.

Reported bug, forgot to link to this thread in the report tho:

CASE IN-76682

This API would be huge for us, if it really worked. We see pretty huge CPU savings in our game using it. We're locked into 2022.3 though, cannot upgrade further. Hoping for a fix in this LTS.

(note: in the memory profiler, it simply shows up under "unknown" - its a unity api so it should probably be tracked properly?)

7 Likes