第一张图中的TOP中,是在该进程中开了10个线程的效果,可以看出VIRT 为94m
第二张图中的TOP中,是最先开启的10个线程都撤消后,又开辟的10个线程,可以看出VIRT 为153m,可以看出前面的线程撤消后,并没有回收资源(代码中是使用
//kill the idle thread and free info struct
kill(this->thread_info[this->cur_th_num-1].thread_id, SIGKILL);) 关闭线程,
其中线程函数一开始调用了pthread_detach(pthread_self())改为
pthread_detach(pthread_self());//pthread_detach(pthread_self()),将状态改为unjoinable状态,确保资源的释放
哪个大神告诉我,怎么释放进程为前面已经结束了的10线程产生的swap空间呢?我是初学者