I am writing streamlink
-alike CLI tool, but capable of downloading multiple twitch.tv live streams simultaneously using goroutines.
After a few hours memory usage is 37% (2 GB RAM) and unix file descriptors hits limit.
- Increasing 'ulimit -n' is not an option.
- Yes, I use
resp.Body.Close()
and'Connection': 'close'
tag anddefer
too.
I give up and need help, read articles, googled it, tried all I know. Please, have a look at code and logs.
P.S: Is there any CLI tool to detect memory leaks?