wenbingshen opened a new pull request, #3913:
URL: https://github.com/apache/bookkeeper/pull/3913

   ### Motivation
   
   PerChannelBookieClient completionObjects occupy a lot of heap space and 
cannot be recycled.
   The figure below shows that the internal table array of 
ConcurrentOpenHashMap has used space size=0, but the array length is still 
16384, and the memory overhead is 65552bytes.
   
![image](https://user-images.githubusercontent.com/35599757/231114802-db90c49b-d295-46d7-b7db-785035b341f0.png)
   
   
![image](https://user-images.githubusercontent.com/35599757/231113930-bd9f3f54-9052-4c0b-9a3f-2fc493632e35.png)
   
   ConcurrentOpenHashMap default DefaultConcurrencyLevel=16. We have hundreds 
of bookie nodes. Due to the feature of bookie polling and writing, the client 
and server have long connection characteristics, which will as a result, the 
memory usage of about 65552 * 16 * 1776 = 1.74GB cannot be recycled, and the 
space take up by these tables is all size=0.
   
![image](https://user-images.githubusercontent.com/35599757/231117087-08c80320-fa71-49c2-a199-cfee3d83ddc5.png)
   
   When the throughput of the pulsar cluster increases and the bookie cluster 
expands, these memory usage will also increase. In addition to some other 
memory usage, the pulsar broker will continuously generate full gc.
   
   ### Changes
   I think adding autoShrink to completionObjects can reduce this part of 
memory usage and reduce the frequency of Full GC.
   
   


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