If they are joinable threads and you haven't called the pthread_join to join them, each produced thread will leak a sizeable amount of memory (at least 10mb per stack) after its termination.
如果它们是可接合的线程,且您没有调用pthread_join来联接它们,那么在线程终止后,每个产生的线程都将泄漏大量的内存(至少每堆栈10MB)。
You can fix the leak by adding code to call pthread_join , which joins each joinable thread.
要修复泄漏,您可以添加代码调用pthread_join,该方法可联接每个可接合线程。
For example, because a hung thread might occur when a wait leak, excessive synchronization, or a deadlock scenario takes place, the hung thread problem consists of three scenarios.
例如,在出现等待leak、过量同步或死锁时会发生hung线程,因此hung线程问题包含这三种场景。
If the number of all thread stacks is greater than the number of active threads, and their dispersion continues growing as the program keeps running, you can conclude that the leak problem does exist.
如果所有线程堆栈的数量大于活动线程的数量,且在程序运行时两者的差量在持续增长,您可以确定内存泄漏问题确实存在。
If the number of all thread stacks is greater than the number of active threads, and their dispersion continues growing as the program keeps running, you can conclude that the leak problem does exist.
如果所有线程堆栈的数量大于活动线程的数量,且在程序运行时两者的差量在持续增长,您可以确定内存泄漏问题确实存在。
应用推荐