1. A concise explanation of the problem you're experiencing.
If I add a KML Datasource to Cesium and then remove it, all of the memory used is not released by the browser unless I also remove all entities in the entity collection, destroy the entity cluster and clear the frustum commands. The first two are easy to do, should they be required though? The last item is not something I feel comfortable doing as its getting into Cesium internals and does not feel like it should be necessary.
The DrawCommands in the Scene FrustumCommandsList hold a reference to the BillboardCollection, so all of the billboards remain in memory unless these are cleared out. Is this a memory leak? Or is there a better way to clear out the DrawCommands when removing a Datasource?
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
Baseline Sandcastle: 50K
After Adding Facilities KML: 170K
Just remove the data source: 138K
Also clear entities: 93K
Also destroy entity cluster: 91K
Also Clear Frustum Commands: 53K
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
Cesium memory usage continues to grow as users add and remove KML data. This might not be specific to KML, that was just the data source type I used for testing.
4. The Cesium version you're using, your operating system and browser.
Cesium 1.42, Windows 10, Chrome v64