vbauerster / mpb

multi progress bar for Go cli applications
The Unlicense
2.29k stars 123 forks source link

Memory leak #115

Closed anacrolix closed 1 year ago

anacrolix commented 1 year ago

When running with 100s of bars (most of which "complete" and stop being updated), memory begins to climb. This behaviour remains even if I Abort my Bars.

image

There's a corresponding increase in CPU use too,

pprof001.

Thanks for the cool library.

vbauerster commented 1 year ago

Thanks for reporting! I think I know why is that.

vbauerster commented 1 year ago

Can you please test with head master? Should be fixed.

vbauerster commented 1 year ago

Just for reference, the bug introduced in 11d342b48a6a6fae11cce739aca22c825bc1fafa. It appears only when bars don't fit to terminal, i.e. number of bars are greater than terminal height.

anacrolix commented 1 year ago

I'm not sure I can test this now, I've switched to another library for the progress bars and they're deeply integrated into some other changes.

anacrolix commented 1 year ago

I went back and tried it against master. I cannot reproduce either the memory or CPU problems anymore!