If your script does not require a handle to the texture after applying it to the model, then you can immediately remove it after using it. Example:
Code:
tex = viz.addTexture(...)
model.texture(tex)
tex.remove()
I just added a
texture.remove() call to the 4 places in your script where you add a texture and the memory is properly released now.