We have an object made with a cylinder mesh that we use to help place target points in the IDE that uses a 1024 texture (mostly just convenience). There are perhaps 20-30 of these objects in the scene.
Right now they are set to be deactivated on Start so that they are not visible.
My question is, in terms of main system memory overhead, is it better to deactivate or Destroy them (there is no user option to turn them back on again once the scene is running). I realize that the objects are not rendering when they are disabled, but I’m wondering about the texture taking up space in RAM still (assuming that no other objects are using this texture).
Is the texture being held in VRAM anyway as well?
Thanks
Broader question: Is there any way to get Unity to report the ammount of RAM and VRAM being used at any given time? Then he could do his own memory check to settle it.
You can profile your app with Shark.
About deactivating vs destroy, remember that while an object exists, it is still completely stored in RAM.
The only use, performance-wise, of deactivating is to prevent rendering calculations for speed, and VRAM use. The object’s transform is still tracked, along with everything else for the most part.
So, when in doubt, Destroy. Then Unity can clean up and free the memory used by the object, (or pass it to another object if they use pooling).
That being said, it shouldn’t be an issue with just a few objects, and VRAM wouldn’t be used unless it is being rendered.
HTH, and UT can clear it up if needed.
-Jeremy