Destroying viewer with 3d tiles doesn't release memory

283 views
Skip to first unread message

thomas.k...@gmail.com

unread,
Aug 21, 2019, 1:34:18 PM8/21/19
to cesium-dev

Omar Shehata

unread,
Aug 23, 2019, 4:09:23 PM8/23/19
to cesium-dev
You might consider caching the viewer, and removing the tileset (perhaps you can hide the canvas element when you need it to be removed). There are some known issues with trying to recreate the viewer and the browser not letting resources go:

thomas.k...@gmail.com

unread,
Aug 24, 2019, 2:29:45 PM8/24/19
to cesium-dev
Thank you for your help, Omar.

Your workaround works in the Sandcastle. But, in my project, the cesium canvas is embedded in a Bootstrap modal which is called using ajax. It is supposed to create a new viewer for a new cesium canvas whenever a new modal is shown.

Our team has spent a lot of time and effort to prepare 3d tiles and utilize them within our product. Now, we get stuck because of the memory leak issue. I would really appreciate if you run into any solutions and share with me.

Omar Shehata

unread,
Aug 26, 2019, 2:04:17 PM8/26/19
to cesium-dev
Perhaps you could write a wrapper around the Cesium viewer, so its "destroy" function just hides it and removes all primitives, instead of completely removing the viewer? And then you can pass this custom object to your Bootstrap modal instead of passing the Cesium viewer directly.

Let me know if that helps. What kind of project is this for?
Reply all
Reply to author
Forward
0 new messages