Dispose things correctly in three.js

There is also a guide in the official documentation with (hopefully) useful information about this topic:

How to dispose of objects

2 Likes

Yes, it was a great example. It just didn’t occur to me before now that I could reuse geometries and materials. Thanks for helping me see that :smiley: And thank you @Mugen87 also for the guide! :slight_smile: And @marquizzo for your answers. I know what to do with my code now :slight_smile:

Hello everyone!

This discussion take place 2 years ago, but I am getting the same problem right now (2021). I am new in ThreeJs.

You can see the game I am working on (still in development) at this address:

http://milk-way.s3-website-us-west-1.amazonaws.com/

(the problem can be seen when you enter space and fly).
I am stucked in the game development just because the memory consume is growing forever, so after some minutes flying around it is not possible anymore. The dispose() is not freeing memory.

Some new tip?

1 Like