tesla1995 opened a new issue #956: 建议线程退出时,把LocalPool中未使用item的id也加入到全局空闲队列
URL: https://github.com/apache/incubator-brpc/issues/956
 
 
   **Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)**
   在文件 `src/butil/resource_pool_inl.h` 
中,线程退出时,析构LocalPool对象,在LocalPool的析构函数,只将_cur_free的item的id加入到全局空闲队列,是不是考虑把_cur_block中未使用的item的id也加入到全局队列,以减少内存浪费呢?
   
![localpool](https://user-images.githubusercontent.com/11598872/68085854-5d886680-fe80-11e9-8d46-f2288450b545.png)
   
   
   **Describe the solution you'd like (描述你期望的解决方法)**
   
析构LocalPool对象时,判断_cur_block->nitem是否小于BLOCK_NITEM。如果是,说明_cur_block中有未使用的item,把这部分item的id也要加入到全局的_free_chunks中。
   
   **Describe alternatives you've considered (描述你想到的折衷方案)**
   
   
   **Additional context/screenshots (更多上下文/截图)**
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to