Out of control memory when updating position of lines within animate function

That’s how .setPositions() works: three.js/LineSegmentsGeometry.js at 380f0f63e27753f7a34ef2be836db09f1f9963f4 · mrdoob/three.js · GitHub
It doesn’t update the existing attributes, it creates new ones.