Select to view content in your preferred language

Destroying tabletop map game object in Unity causes memory leak.

315
2
08-16-2024 10:05 AM
GeoffreyBund
Emerging Contributor

I've only tested for this on Android. When we delete a tabletop map gameobject, the native heap memory usage and graphics memory usage doesn't go back to zero (the level before the map was initialized). I've tried to manually destroy the rendertextures, materials, meshes, and textures in the GPUResourceProvider before deleting the map and tried deleted the rendertexture related to terrain occlusion in the ArcGISRenderer script but I either still get the memory leak or the  app crashes, likely because of some improper destroy function I'm running in my manual code. I want to know what the best way is to remove an ArcGIS map from a unity scene without causing a memory leak. Its clear that just deleting the map gameobject doesn't help. The render textures, meshes etc for the map  that are cached don't seem to be destroyed during garbage collection.

Tags (2)
0 Kudos
2 Replies
MasonGaw
Regular Contributor

Hi there,

I can take a look into this. I believe the only time we have ever tried destroying a map and all of its accompanying game objects is when physically switching scenes. With that said, we haven't tried it with our  table top sample. I'll take a look at this today and get back to you asap.

Mason

0 Kudos
GeoffreyBund
Emerging Contributor

Much thanks @MasonGaw . Please let me know what you find.

0 Kudos