# Performance of loading large 3d tiles model

**URL:** <https://community.cesium.com/t/performance-of-loading-large-3d-tiles-model/14998>\
**Category:** CesiumJS\
**Created:** [August 25, 2021, 12:15pm UTC](https://community.cesium.com/t/performance-of-loading-large-3d-tiles-model/14998 "2021-08-25T12:15:24Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![helloFriday](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hellofriday/32/6065_2.png) [@helloFriday](https://community.cesium.com/u/helloFriday)\
**Post date:** [August 25, 2021, 12:15pm UTC](https://community.cesium.com/t/performance-of-loading-large-3d-tiles-model/14998/1 "2021-08-25T12:15:24Z")

</div>

**1. A concise explanation of the problem you’re experiencing.**  
Hi all, Now I need to load a big 3dtiles file(200g+). There are 1,000+ tileset json files and 1,000,000+ b3dm files.  
When I open it in browser, the memory increases gradually, fps is very low, and the webpage crashes at last. So I wonder  
(1) Are there any problems in the creation of these tiles probably and obviously? It is not my job… But it is better to give me some ideas.  
(2) Although we could optimizate these tiles and make them smaller, we will use larger data in the future. Except for maximumScreenSpaceError and maximumMemoryUsage, are there any other helpful params or ways to render faster and stably?

directory of data  
 ![dir](https://global.discourse-cdn.com/cesium/original/2X/4/4296482ca9bf8192c09769a73ad49c98d9d70a95.png)

another smaller data of the same type , a lot of commands?

 ![inspec](https://global.discourse-cdn.com/cesium/original/2X/5/54d5b873147a8e9b69e09b5e01cd9291bf5d0b6b.jpeg)

**2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.**

```auto
var tileset = viewer.scene.primitives.add(
        new Cesium.Cesium3DTileset({
          url, // big b3dm data, a commercial project, upload prohibited
          maximumScreenSpaceError: 256, // set a big number for test, faster but rough
          maximumMemoryUsage: 4096,
          skipLevelOfDetail: true,
          preferLeaves: true,
        })
)

```

**3. Context. Why do you need to do this? We might know a better way to accomplish your goal.**  
We need to show our big b3dm model after massive photos reconstruction.

**4. The Cesium version you’re using, your operating system and browser.**  
1.71, windows 10, Chrome 92.0.45

Thanks all for any help given~ 😄

---

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [August 26, 2021, 3:53pm UTC](https://community.cesium.com/t/performance-of-loading-large-3d-tiles-model/14998/2 "2021-08-26T15:53:54Z")

</div>

@helloFriday

Welcome to the community! Thank you for providing so many details in your first post 🚀 😀

You are clearly working with a significant amount of data! Just so I am clear, are you currently using Cesium ion to tile and stream your data? If so, how exactly are you uploading this data to Cesium ion?

`maxiumumScreenSpaceError` and `maxiumumMemoryUsage` are often the best tools to use when optimizing render speed and general stability. The code that you shared looks fine. The parameters that you are using for `maxiumumScreenSpaceError` and `maxiumumMemoryUsage` seem reasonable. Have you experimented with changing `preferLeaves`?

Let me know if you have any other questions or concerns. I am looking forward to learning more!

-Sam

---

<div class="post-metadata">

**Author:** ![xiaoshitou666](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/xiaoshitou666/32/6111_2.png) [@xiaoshitou666](https://community.cesium.com/u/xiaoshitou666)\
**Post date:** [August 29, 2021, 1:21am UTC](https://community.cesium.com/t/performance-of-loading-large-3d-tiles-model/14998/4 "2021-08-29T01:21:27Z")

</div>

I have the same problem. Have you solved it now

---

<div class="post-metadata">

**Author:** ![heyFriday](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/heyfriday/32/6121_2.png) [@heyFriday](https://community.cesium.com/u/heyFriday)\
**Post date:** [August 29, 2021, 12:26pm UTC](https://community.cesium.com/t/performance-of-loading-large-3d-tiles-model/14998/5 "2021-08-29T12:26:50Z")

</div>

Not yet…I am still in trouble. Do u have any good idea

---

<div class="post-metadata">

**Author:** ![heyFriday](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/heyfriday/32/6121_2.png) [@heyFriday](https://community.cesium.com/u/heyFriday)\
**Post date:** [August 30, 2021, 2:11am UTC](https://community.cesium.com/t/performance-of-loading-large-3d-tiles-model/14998/7 "2021-08-30T02:11:10Z")

</div>

Hi Sam,  
Thanks for the reply! 😄 I don’t use Cesium ion. It is a local model on my computer. PreferLeaves could help me show the model faster.

In fact, high memory consumption is my biggest problem. I couldn’t show this large model successfully because of js heap out of memory error.  
I wanna know how could I reduce memory consumption of Cesium?

For example, in Chrome memory panel, a variable called **Cesium3DTile** is too big. its length equals the total number of my b3dm files. I know it may help to search for nodes. But when the page tries to load the 200g+ model, js memory runs out easily and the page crashes.

p.s. It is a electron project.

another smaller data of the same type

 ![WX20210828-162916@2x](https://global.discourse-cdn.com/cesium/original/2X/1/1ed525c5835e0e6ffed8810eb28de99fd5deafbd.jpeg)

---

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [August 30, 2021, 6:03pm UTC](https://community.cesium.com/t/performance-of-loading-large-3d-tiles-model/14998/8 "2021-08-30T18:03:20Z")

</div>

@heyFriday

Thank you for the update. To be candid, I have never encountered this issue before. 200g models are extremely large and may have limited support across platforms even if you can optimize them for computer web browsers. Have you tried uploading your data to Cesium ion and streaming it to CesiumJS? I recommend giving this a try. If it does not resolve your issue, it will still allow us to see how exactly your data is being processed. This information can help us find a robust solution moving forward. In the meantime, **input from the community would be welcomed!** It’s possible that other community members have dealt with similar issues in the past.

-Sam

---

<div class="post-metadata">

**Author:** ![Adrian\_Onsen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/adrian_onsen/32/1987_2.png) [@Adrian\_Onsen](https://community.cesium.com/u/Adrian_Onsen)\
**Post date:** [September 8, 2021, 1:28pm UTC](https://community.cesium.com/t/performance-of-loading-large-3d-tiles-model/14998/9 "2021-09-08T13:28:10Z")

</div>

@heyFriday  
How did you create the 3d tiles?  
Two potential problems spring to mind:

- The `tileset.json` file is not set up correclt. It looks to me like CesiumJS is loading ALL the 3d tiles at once which is not right.
- You don’t have proper LODs created, and all the b3dm files get loaded at the root level of the `tileset.json`

Can you share just the `tileset.json’ file on this forum? We might be able to figure out more if we see that file.

Correct me if I’m wrong @sam.rothstein but with a correcly set up ‘tileset.json’ CesiumJS should only load a few tiles when you’re zoomed out. The tiles at the highest LOD level, which are not very big.

---

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [September 8, 2021, 4:16pm UTC](https://community.cesium.com/t/performance-of-loading-large-3d-tiles-model/14998/10 "2021-09-08T16:16:22Z")

</div>

@Adrian_Onsen

Thank you for adding this here! Your suggestions/questions are perfect. @heyFriday I am looking forward to hearing your thoughts.

-Sam

---

<div class="post-metadata">

**Author:** ![heyFriday](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/heyfriday/32/6121_2.png) [@heyFriday](https://community.cesium.com/u/heyFriday)\
**Post date:** [September 9, 2021, 9:11am UTC](https://community.cesium.com/t/performance-of-loading-large-3d-tiles-model/14998/11 "2021-09-09T09:11:03Z")

</div>

Thanks a lot~ 😺

What you said makes sense. It is our work direction too. On the one hand, we viewed the source code of CeisumJS, and my colleagues are trying to optimize the `tileset.json` files. The model has a lot of `tileset.json` files. Actually in our project, CesiumJS doesn’t load all 3d tiles at once but creates all `Cesium3dTile` objects. This is our problem. Now optimization work continues. No results yet. I will update soon if there are any developments. And I will upload the files if needed.

On the other hand, for frontend, I upgrade our Electron (it is too old…). V8 engine 8.0 reduces heap greatly, so the memory reduces. At the same time I use `--max-old-space-size=xxx` to increase the memory limit for Node.js. Now it can load the model successfully at least.

---

<div class="post-metadata">

**Author:** ![chenwwsdo](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/chenwwsdo/32/6028_2.png) [@chenwwsdo](https://community.cesium.com/u/chenwwsdo)\
**Post date:** [November 19, 2021, 8:56am UTC](https://community.cesium.com/t/performance-of-loading-large-3d-tiles-model/14998/12 "2021-11-19T08:56:13Z")

</div>

Hello, I have the same problem, how do you solve it? 😄

---

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [November 22, 2021, 1:05am UTC](https://community.cesium.com/t/performance-of-loading-large-3d-tiles-model/14998/13 "2021-11-22T01:05:44Z")

</div>

@chenwwsdo

This seems to an important component of the solution.

> [@heyFriday](#):
>
> On the other hand, for frontend, I upgrade our Electron (it is too old…). V8 engine 8.0 reduces heap greatly, so the memory reduces. At the same time I use `--max-old-space-size=xxx` to increase the memory limit for Node.js. Now it can load the model successfully at least.

Please read the entirety of this thread for more details. Let me know if you have any other question or comments!

-Sam

---

<div class="post-metadata">

**Author:** ![heyFriday](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/heyfriday/32/6121_2.png) [@heyFriday](https://community.cesium.com/u/heyFriday)\
**Post date:** [November 23, 2021, 9:00am UTC](https://community.cesium.com/t/performance-of-loading-large-3d-tiles-model/14998/14 "2021-11-23T09:00:28Z")

</div>

New Progress: 😀  
We didn’t upgrade our Electron finally. Because we find that V8 8.0 puts a 4GB maximum on the heap size.

---

<div class="post-metadata">

**Author:** ![helloFriday](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hellofriday/32/6065_2.png) [@helloFriday](https://community.cesium.com/u/helloFriday)\
**Post date:** [April 10, 2023, 6:54am UTC](https://community.cesium.com/t/performance-of-loading-large-3d-tiles-model/14998/15 "2023-04-10T06:54:49Z")

</div>

New Progress: 😀  
The most important work is model simplification.  
e.g. [Faster and Smaller 3D Tiles with WebP Image Compression – Cesium](https://cesium.com/blog/2019/02/12/faster-3d-tiles-streaming-webp/)

---

<div class="post-metadata">

**Author:** ![Adrian\_Onsen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/adrian_onsen/32/1987_2.png) [@Adrian\_Onsen](https://community.cesium.com/u/Adrian_Onsen)\
**Post date:** [April 29, 2023, 11:49am UTC](https://community.cesium.com/t/performance-of-loading-large-3d-tiles-model/14998/16 "2023-04-29T11:49:23Z")

</div>

@helloFriday have you considered converting the texture of the b3dm models to KTX 2.0 image format?

The main advantage is that the textures remain compressed while in GPU memory. meaning more tiles can be loaded with the same amount of memory.
