Memory Leak with Dynamic Grid lines

1. A concise explanation of the problem you’re experiencing.

I’m creating mgrs grid lines every time the camera moves in a imageryProvider using a PolylineCollection added to the primitives. I’m seeing the memory increase as I zoom in and out or pan. I using the removeAll function call from the PolylineCollection, but that doesn’t seem to be releasing all of the memory. I thought maybe I should use the Entity API, but after trying to use the EntityCollection I kind of gave up using entities.

  1. Is there an issue with removing polylines?

  2. Is there a better idea using entities with polylineGraphics that I should be trying? Any suggestions would be greatly appreciated.

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it. My code is largely based upon this example.

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

This is a requested feature for our simulation platform.

4. The Cesium version you’re using, your operating system and browser.

Cesium v 1.36

Windows 7


Hi Scott,

I believe you are seeing this issue (#5827) in action. Good news, there’s currently a pull request open to fix it! We’ll notify this thread once it gets merged.



This issue was fixed and is included in the Cesium 1.38 release.