When drawing a large number of pointPrimitives in real time, a memory leak occurs

Hello,everyone.
I was drawing some pointPrimitiveCollections, each collection contained more than 20,000 pointPrimitives, and kept adding new collections as the mouse moved, then I got a very low frame rate and a memory leak. When I use snapshot of Chrome devTools, it prompts ‘render process gone’. In addition, I didn’t use removeAll() or destroy() because they would make the points invisible. But I don’t know how to release pointPrimitives.
How can I improve the performance? Anyone have any advice for me?
Thanks!

Hi @xho-han

Could you please provide a Sandcastle that replicates this issue?

Thanks,
Sam.

Hello @sanjeetsuhag
Thank you for your response. Here’s my Sandcastle.
Looking forward to your reply.Thank you again.

@xho-han I am unable to see any points render in the Sandcastle you provided. Additionally, it seems like you are spawning a worker thread every time to create a PointCollection. Is there any particular reason that’s necessary?

@sanjeetsuhag I’m sorry for my points data stored in HBase server, so it’s not convenient to show it in the Sandcastle. And the worker thread is used for the projection process of the points.

It seems to take longer because of point-by-point projection and adding to a collection. Is there a way to add multiple points to a collection at once?