Thanks Jan,
that is a good explanation since I do use a lots of gorotines,
but I supposed they are not mapped to OS threads that frequently.

Correct me if I am wrong, as far as I know there is no way to recycle them.

Is it correct that any IO to socket or file makes gorotine an OS thread?
What about mutexes and sleeps?

I can rethink the architecture to do all IO from dedicated gorotines,
but need to confirm the list of "forbidden" operations.

Thanks again!
On Wednesday, October 6, 2021 at 8:56:00 AM UTC-7 Jan Mercl wrote:

> On Wed, Oct 6, 2021 at 5:43 PM Renat Idrisov <parsi...@gmail.com> wrote:
>
> > Total allocations of golang program are about 42MB, but go runtime takes 
> 8GB for in OS thread stacks.
> > What am I doing wrong?
>
> If you're on 64 bit Linux, chances are the default OS thread stack
> size is 8 MB. In that case your program uses ~1000 OS threads. That
> might be unexpected or it might be caused by some bug. So you should
> probably focus first on finding out why your program uses such
> many/too many OS threads, provided this hypothesis is somehow
> connected to reality.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/a6528cd3-93d8-42c3-98e6-65da6ba9d9dcn%40googlegroups.com.

Reply via email to