You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2020/07/07 08:15:24 UTC

[GitHub] [incubator-brpc] kof02guy commented on issue #1136: rq满导致的死锁问题求解决方法

kof02guy commented on issue #1136:
URL: https://github.com/apache/incubator-brpc/issues/1136#issuecomment-654679871


   > > > @kof02guy 从 ObjectPool 中分配的对象所占用的内存是不会归还给系统的,如果到达最大值,再从里面分配,会返回null.
   > > > 这个最大值从代码看目前不能调整, 是const 常量.
   > > > ObjectPool 适用于分配比较固定大小的 ,且生命周期比较短暂的,分配完之后,可能过一会儿就归还给Pool的object。这样ObjectPool 保持一个动态平衡。在这样的场景下, 性能应该很高.
   > > 
   > > 
   > > 有的场景下,可能系统存在一个很高的性能尖峰,在那个尖峰可能需要分配很多的资源。但是在大多数情况下,系统的压力都很低,那些在性能尖峰分配出来的资源如果不shrink的话,那么相当于是变相的资源浪费了
   > 
   > 如果性能尖峰是周期性的,拉长时间线来看,感觉也不算是资源浪费,因为这些资源会被下一个性能尖峰复用。
   
   嗯其实类似这样的池类的实现基本上都会周期性地shrink,或者至少有接口或者参数让用户可以有些许控制权,例如golang里的内存管理。因为一方面不一定下一个尖峰会到来,另一方面整个机器上可能会有别的资源需求,如果都被hold在这里而不能有效利用的话,那其实不是很合理。


----------------------------------------------------------------
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:
users@infra.apache.org



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