The OS is shutting down our app due to high memory usage.
In our app, each “room” is an immersive space with a skybox. Within the room we navigate through a variety of spaces, each with its own texture to be used in the skybox material. Each time we swap out the skybox material the memory usage grows significantly.
When we exit each room (immersive space), we remove the skybox (removeFromParent), assign it to nil, and have even tried to set the Texture to nil. Exiting a room doesn’t appear to release any of the allocated memory. Each time we enter a new room the memory usage climbs until we reach about 5G, by which time the app is closed by the system.
Should we remove the UnlitMaterial reference in each room object as well upon exiting immersive space?
We also observed that when we navigated through spaces that we’ve previously visited, the Persistent Bytes don’t grow even though we are releasing the Texture resource upon exiting a space, then re-creating the TextureResource when we enter it again.
Could these Textures or Materials be cached by the system? Our images are high resolution 16K images.
VisionOS 26,
Xcode 26.1.1
Meanwhile we are going through the code base line by line to make sure we haven’t maintained a strong reference to the skybox or texture resource elsewhere.
Attaching memory allocations at shutdown:
Thanks,
bvsdev