Pthreads - High memory usage

后端 未结 6 2015
梦谈多话
梦谈多话 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:38

    May be this is the reason:

    "(Recognizing leaks

    If you create a joinable thread but forget to join it, its resources or private memory are always kept in the process space and never reclaimed. Always join the joinable threads; by not joining them, you risk serious memory leaks.)"

    Read it here: http://www.ibm.com/developerworks/library/l-memory-leaks/

提交回复
热议问题