shibd commented on code in PR #991:
URL: https://github.com/apache/pulsar-client-go/pull/991#discussion_r1142204396


##########
pulsar/consumer_partition.go:
##########
@@ -1752,6 +1762,37 @@ func (pc *partitionConsumer) markScaleIfNeed() {
        }
 }
 
+func (pc *partitionConsumer) reserveMemory(size int64) {
+       pc.client.memLimit.ForceReserveMemory(size)
+       if pc.client.memLimit.CurrentUsagePercent() >= 
receiverQueueShrinkMemThreshold {

Review Comment:
   > OK, I see. But even in Java client, reduceReceiverQueue() can not free 
memory immediately. It just controls next flow to prefetch fewer messages.
   
   > It just controls next flow to prefetch fewer messages.
   
   Yes, We need these inactive consumers to reduce the size of the pull flow so 
that it can give memory to more active consumers.
   



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