I selected “Show Picked Only” and “Memory Usage (MB)” and set a large enough maximumCacheOverflowBytes to load a high-definition tile and checked the memory consumption of this. As shown in the figure below, the total for Texture and Geometry was 100 MB.
Note that “Show Picked Only” means that it only displays the memory usage of the tile under the mouse cursor. When you disable “Show Picked Only”,then it will display the information for all tiles (but depending on how many there are, this may be hard to read…)
The maximumCacheOverflowBytes setting required to draw the high-definition tile in the above figure was 8 times the default value (4,096 MB). (Seven times the default (3,584MB) would have rendered the low-definition tile by one level.)
The default value for the cacheBytes
and maximumCacheOverflowBytes
is 512MB. This is very conservative. On a modern desktop PC (with 16, 32, or even 64 GB of RAM), you can set these values much higher (some additional details below).
I don’t know what exactly “the path of tiles” indicates, but is it something that consumes 3,484 MB of memory?
…
Does that mean that the root tile will always hold information other than “the path of tiles” and will not be freed up for the high definition tiles?
The “path of tiles” refers to the sequence of tiles, starting at the root tile, going through all the child tiles, down to the tiles that are currently visible for the camera. A quick, crude drawing:
Even though the (low-detail) geometry of the tiles on this path is currently now rendered, the tiles on the path (marked in red) have to be kept in memory. And when, for eexample, the root tile occupies a lot of memory, then this may affect the loading of the other tiles.
I set this to 8 times the default (4,096MB) and the high-resolution tiles were rendered. 4,608MB together with maximumCacheOverflowBytes seemed to render even the high-resolution tiles.
(I am not sure of the difference between “cacheBytes” and “maximumCacheOverflowBytes”…)
I did ask about that internally. An attempt to summarize it:
- The
cacheBytes
is the size of the cache that is allowed. Increasing this will allow more tiles to be kept in the cache, and can decrease load times when navigating through a tileset, at the cost of a higher memory consumption
- The
maximumCacheOverflowBytes
is the amount by which th cacheBytes
has to be exceeded before CesiumJS forces the use of lower-detail tiles.
So I think that you could resolve the issue even by only setting the maximumCacheOverflowBytes
to a “very large” value. But again: The “best” settings here depend on many factors (the exact structure of the tileset, the way of interaction, and of course, the machine that all this is running on).
And, as mentioned in the first response here: I think that reducing the size (in pixels) of the textures (or maybe compressing them with KTX) could be a good way to significantly reduce the memory consumption. Looking at the last screenshot that you posted: This grainy, noisy, brown texture takes 80 Megabytes of memory. It think that this could be reduced to … maybe 1 (one) Megabyte without significant loss of quality…