Pthreads - High memory usage

后端 未结 6 2011
梦谈多话
梦谈多话 2021-02-08 15:42

I am programming something in C that creates a lot of Pthreads in Linux on a 256Mb system. I usually have +200Mb free.

When I run the program with a low amount of thread

6条回答
  •  走了就别回头了
    2021-02-08 16:20

    Not sure it will help, but try calling setrlimit with RLIMIT_STACK to limit the stack size to 16k before creating your first thread.

提交回复
热议问题