ascii-progress icon indicating copy to clipboard operation
ascii-progress copied to clipboard

ProgressBar instances not garbage collected

Open erhhung opened this issue 7 years ago • 0 comments

I wanted to simulate showing the progress of downloading hundreds of files but throttled to a small number of simultaneous downloads, so I created a simple example: https://gist.github.com/erhhung/3b8bdcbac3004907acf28de40a1cf21a

It seems that new ProgressBar instances are continuously being pushed onto the global instances[] array but never removed. I haven't looked into the code in detail to locate resource leaks, though the heap usage seems to be fairly stable.

I do see a couple of .forEach() loops on the instances[] array, so it will unnecessarily check more and more completed bars over time.

erhhung avatar Aug 11 '18 01:08 erhhung