I am drawing a flight path dynamically using PolylineCollection. I add one Polyline to my PolylineCollection and Keep setting polyline's positions attribute. The problem is as number of points increase the memory uses by the browser(Chrome) also increases dramatically(1.5GB for 1000 Points) and if i keep running the process it will crash(at around 1500-2000 Points). Below is the code i am using to draw my path
var positions = ;
var pathPolylineCollection = new Cesium.PolylineCollection();
pathPolylineCollection.add({
positions: positions,
width: 2,
show: true,
material: Cesium.Material.fromType('Color', {
color: new Cesium.Color(1,1,1,1)
})
});
// adds a single point to path
var addPoint = function(XYZPoint){
positions.push(XYZPoint);
var polyline = pathPolylineCollection.get(0);
polyline.positions = positions;
}