Gleiphir2769 commented on code in PR #991:
URL: https://github.com/apache/pulsar-client-go/pull/991#discussion_r1141799619
##########
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:
The reasons here are not the same as those implemented by the Java client:
1. I don’t think it matters whether this is triggered by `memory limiter` as
long as the `shrink` is not triggered repeated.
3. If we want to implement it like the Java client, we need to modify the
`memory limiter` to allow it to support a trigger, but I feel like this in
itself is an unnecessary code coupling.
--
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]