ebeaufay / threedtiles

3DTiles viewer for three.js
MIT License
270 stars 32 forks source link

Very high memory usage #10

Closed wangdemon closed 1 year ago

wangdemon commented 1 year ago

The computer's memory usage is high and rising.

The testing model file

output.002.zip output.003.zip output.004.zip output.005.zip output.006.zip output.007.zip output.008.zip output.001.zip

download model files, and uzip 2

1

https://user-images.githubusercontent.com/20681339/199158267-1f8b857a-aa8f-46fa-87b4-1f361c2d1f0a.mp4

ebeaufay commented 1 year ago

Hi @wangdemon ,

There are several possible causes, the first thing you can try is to lower the geometric error multiplier.

Then, you need to check if the 3DTiles structure is optimal for streaming. Individual tiles should be around 500Kb and best is to have a tree structure like a bi-tree or octree.

Can you show me the structure inside the LOD folders?

Furthermore, you set the TileLoader maxCachedItems at 1000. If your tiles are big, this may be too much. Try to set it at a low number (even 0) to see if that fixes the issue

wangdemon commented 1 year ago

Thank you very much, When I change the geometric error multiplier to 0.01, the memory is really much less.

But the maxCachedItems value, It seems to have no effect on memory.

Watch the video below:

https://user-images.githubusercontent.com/20681339/199867883-ea921e76-db46-45ad-b88c-db43a409a403.mp4

I think the memory is still a little large.

The model has been uploaded, you can also test it

ebeaufay commented 1 year ago

I'm unable to open the zips, they are corrupt on my side.

wangdemon commented 1 year ago

LOD-0.zip

LOD-1.zip

LOD-2.zip

LOD-3.zip

LOD-4.zip

LOD-5.zip

tileset.zip

I have uploaded the model file again

ebeaufay commented 1 year ago

So first I see your tiles don't have an optimal structure because level 0 is 30 mb and level 5 is 27 mb. This indicates that the simplification is not sufficient (mesh and/or texture)

You have the same amount of files in each LOD meaning you don't split the meshes in a bi-tree or octree between levels.

For memory, open the developer tools F12 and go to performance and memory tab. The way you check memory usage, you look at chrome memory management, not the page itself

wangdemon commented 1 year ago

OK, thank you very much for your help.