I’ve started using the AssetsManager to load about 40 meshes into my scene. I’ve noticed the loader creates a bunch of dedicated workers, but never seems to dispose of them.
Is there a way to cleanup/dispose the workers after being loaded? Would there be a way to not use workers at all if disposal is not available?
The workers threads are being created when using both
Thanks in advance.
LE: The culprit seems to be the GLTFValidator, running validations on my models. I guess this feature would be helpful in a development environment - but is there a way to disable it when running a production build for example? I would like to avoid creating so many threads especially on mobile devices.
Huh, I took a quick look at the code and the validation is supposed to be off by default. @bghgary any idea of what’s happening?
I ran into this a while back and turned out to be the Inspector being in the bundle turns validation on. @Andi do you have the inspector imported ?
@br-matt I do have the Inspector module active indeed. I also realized the project I’m working on is still running on the 4.2 version of BabylonJs so it might even be a problem with that.
I’m currently trying to run a sandbox project with the latest version to rule out the obvious version mismatch.
I have to keep the inspector in my projects development environment, a workaround I found is explicitly set
validate to false on the loader:
Ok, I can confirm that running on the latest version of Babylon also without the Inspector doesn’t create extra worker threads. This is great news, thank you for your suggestions!