sunshujie1990 commented on code in PR #3001:
URL: https://github.com/apache/bookkeeper/pull/3001#discussion_r906694279


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/AbstractConfiguration.java:
##########
@@ -1060,7 +1061,7 @@ public T setAllocatorPoolingPolicy(PoolingPolicy 
poolingPolicy) {
      * @return the configured pooling concurrency for the allocator.
      */
     public int getAllocatorPoolingConcurrency() {
-        return this.getInteger(ALLOCATOR_POOLING_CONCURRENCY, 2 * 
Runtime.getRuntime().availableProcessors());
+        return this.getInteger(ALLOCATOR_POOLING_CONCURRENCY, 
PooledByteBufAllocator.defaultNumDirectArena());

Review Comment:
   > The default value of `defaultNumDirectArena` is 2 * cpus 
https://github.com/netty/netty/blob/4e439264df0523fb6efce5f8f6c7c7fa74addd07/buffer/src/main/java/io/netty/buffer/PooledByteBufAllocator.java#L413-L418
   
   Thanks for your reply. Netty default value use the min value between 2*cpus 
and max mem  defaultChunkSize / 2 / 3 to avoid oom. And it helps me resolved 
bookeeper oom problem in my product environment. Can you help me to merge it?
   ```
           DEFAULT_NUM_DIRECT_ARENA = Math.max(0,
                   SystemPropertyUtil.getInt(
                           "io.netty.allocator.numDirectArenas",
                           (int) Math.min(
                                   defaultMinNumArena,
                                   PlatformDependent.maxDirectMemory() / 
defaultChunkSize / 2 / 3)));
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to