Help!why switching models causes memory growth

When I use scene loaded in OBJ file or GLTF file,and switching tab0 and tab1 many times,which cause the memory growth!
I’ve done some optimization but without effect。
The memory screenshot,I find 574564564.mtl in the memory and not deallocate

obj memory screenshot


image

gltf memory screenshot

image

The test link

obj test
gltf test

The test code

test code

What things I should care anyway? Thank you.

Let me take a look …

I did a test and it seems after a while, the garbage collector finishes its work and the memory footprint gets back to ‘normal’.
Taking a look at your code, I’m not sure this is the right way to clear the scene:

Can you please try to iterate and dispose all active meshes in the scene ?

Thank you,I will try dispose all active meshes

1 Like