Hi!
Currently I'm using Cesium to visualize certain activity of our userbase around the globe, which will be displayed on a Asus chromebox with an i3 processor.
However, after running for a certain period of time, Chrome runs out of memory and my application crashes. It does run very smoothly for a while however. I believe this indicated there is a memory leak of some sort?
What I'm currently doing:
Using WebSockets I stream from a worker, I receive activities and create entities at their locations, I also save activities in memory, this can increase to up to 2000 / 5000 entities.
After a certain period of time, I remove all the entities and the activities from memory and start over.
It's after resetting twice that the Chromebox runs out of memory. Using the chrome devtools, I found that the n.onmessage call in Cesium uses the most memory.
I'm not sure where to start to tackle this problem.
Some code examples:
How I add entities:
const entity = new Cesium.Entity({
id: activity.id,
position: surfacePosition,
point: {
show: true,
color: Cesium.Color.SEASHELL,
pixelSize: entityProperties.pixelSize,
outlineColor: activityTypeColors[activity.type],
outlineWidth: pixelSize / 2,
scaleByDistance: new Cesium.NearFarScalar(10, 0.5, 1000, 1)
}
} as any);
this.viewer.entities.add(entity);
How I remove entities:
this.viewer.entities.removeAll();
If anybody would be knowing more about this, that would be awesome :)! If this is all a bit unclear, I'd be happy to give more information.
Chrome running on Chromebox: 70.0.035
Cesium version: 1.40