RangeError Array buffer allocation faild

When I draw a large number of entities(about 400 polyline,some polyline may consist of hundreds or even thousands of points), it will consume a lot of memory, resulting in memory allocation failure. What should I do