You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that everything runs fine, but after a while the ram starts filling up on the server, till it gets to the point that it errors out with runtime/cgo: pthread_create failed: Resource temporarily unavailable
I'm unsure if it's a memory leak, or if either instance of youtube-dl is not closing right or if ffmpeg isn't closing right and just consuming more and more ram as the program runs more, until the program crashes with this error
I've also tried building the binary with CGO_ENABLED=0 even though I don't even have a import "c" but that also ends up erroring out as well with
runtime: failed to create new OS thread (have 21 already; errno=11)
runtime: may need to increase max user processes (ulimit -u)
fatal error: newosproc
my limit's are already very generouse, which maybe could also be a problem? Or do I maybe have to increase the pipe size?
$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 192907
max locked memory (kbytes, -l) 16384
max memory size (kbytes, -m) unlimited
open files (-n) 100000
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 65536
cpu time (seconds, -t) unlimited
max user processes (-u) 63883
virtual memory (kbytes, -v) unlimited
Either way, I apprecate any and all the help I can get on this.
The text was updated successfully, but these errors were encountered:
You will most likely get better and faster answers on a forum, rather than on this issue tracker. See https://golang.org/wiki/Questions.
The error about pthread_create failed: Resource temporarily unavailable normally means that you are trying to create too many threads. It can occasionally mean that you are allocating too much, memory, but that is much less likely. Note that number of permitted threads is across all your programs, not just one.
I went ahead and posted it on StackOverflow with a 200 point bounty. But this happens regardless of the server size, 20 core box or 40 core box with 50+ gig's of ram, with even a low number of requests and time. So I think it's more of a leak somewhere or something hanging.
It would help if you could post a complete program in your Q.
I haven't found the quality of Go responses on SO to be that good, tho I haven't looked lately. You might at least post a link to that Q on golang-nuts.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?$ go env linux amd64
What did you do?
I currently have this function, that pipes multiple youtubedl commands thru ffmpeg, and then pipes the output of ffmpeg to an HTTP client.
The problem is that everything runs fine, but after a while the ram starts filling up on the server, till it gets to the point that it errors out with
runtime/cgo: pthread_create failed: Resource temporarily unavailable
I'm unsure if it's a memory leak, or if either instance of youtube-dl is not closing right or if ffmpeg isn't closing right and just consuming more and more ram as the program runs more, until the program crashes with this error
I've also tried building the binary with
CGO_ENABLED=0
even though I don't even have aimport "c"
but that also ends up erroring out as well withmy limit's are already very generouse, which maybe could also be a problem? Or do I maybe have to increase the pipe size?
Either way, I apprecate any and all the help I can get on this.
The text was updated successfully, but these errors were encountered: