Commit 7a25945
authored
Fix memory leak when loading texture with ImageBitmap (#499)
During rendering large-scale 3DTiles with high resolution textures, we identified a memory leak problem. When continuously loading new tiles, memory usage would constantly increase without being released. And the browser will crash after console reported the error `Couldn't load texture blob: http://xxx`
I found that it cause by GLTFLoader loaded textures with ImageBitmap and did not close or dispose it when tiles be disposed. https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/GLTFLoader.js#L2547
After this fix, I have tested that the memory won't increase endlessly. It will reach the top when geometry and textures in scene maintain in a reasonable value.
related issue: mrdoob/three.js#239531 parent 0df8db3 commit 7a25945
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
768 | 775 | | |
769 | 776 | | |
770 | 777 | | |
| |||
0 commit comments