To dispose or not to dispose, that's the question

To use Shakespeare’s paraphrase “To dispose or not to dispose, that’s the question” I’m using lots of textures and probably I won’t use them later but it could be.

Should I dispose of them or Babylon itself will take care of the memory usage (especially in smartphones)?

Thank you for your help!

1 Like


Babylon won’t take care of disposing textures you are not using anymore, unless you disposed of the materials that use those textures. Or if you dispose the meshes that are using this material and notify babylon to also dispose the material.

If you know something can be disposed - dispose it. Or as Shakespeare said - “Dispose! dispose! my kingdom for dispose!”.


Modest doubt is called the beacon of the wise :slight_smile:


Thank you!
W.Shakespeare again: “To die, to sleep, to sleep, perchance to code using BabylonJS"