multithreading - GO: runtime: program exceeds 10000-thread limit -


when using go, got error 'runtime: program exceeds 10000-thread limit'.

that information goroutine. 'sched 229357ms: gomaxprocs=16 idleprocs=0 threads=8797 idlethreads=8374 runqueue=2131 gcwaiting=0 nmidlelocked=141 nmspinning=0 stopwait=0 sysmonwait=0'

we can see has 8374 idlethreads, no reason create more thread os.

why program exceeds 10000-thread limit?

no way provide definitive answer without lot of program code. , doubt can provide simplified example hit problem. 10,000 threads lot of threads.

what guess because go creates new thread each goroutine's blocking operations, have lot of goroutines doing blocking calls.

i not sure, think each goroutine keeps own blocking call thread , not pooled. having more 10,000 goroutines each make blocking calls may issue.

all guesses though.

edit:

found way increase 10,000 thread limit: https://golang.org/pkg/runtime/debug/#setmaxthreads

debug.setmaxthreads(20000)


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -