-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High memory allocation when using longer AckTimeout #288
Comments
Btw, the reason why we discovered this issue is that if we have the consumer set as the default (Zero) it seems that the client library effectively sets the ack timeout to 30s (which is a discrepancy to the Java client that keeps it as infinite). |
@adrianotr good notice! It indeed correlates well with the code which totally correlates with Java code
Not sure I understand what is the issue though |
Hi, thanks for the quick response. Sorry for not being very clear; let me explain that better.
It's a separate issue, but basically it's why we were using very long ack timeouts. If you don't set the ack timeout, then the lib sets the ack timeout to 30s instead of keeping it as zero (only when retries are enabled apparently). This is what I meant that is different from the Java client.
So the problem there is not the correlation but the immense amount of memory used.
|
That's incorrect, Pulsar.Client follows Java and sets timeout to zero
I've provided the code reference so you could understand why the amount of memory used gets increased. let stepsCount = Math.Ceiling(ackTimeout.TotalMilliseconds / tickDuration.TotalMilliseconds) |> int
for _ in [1..stepsCount] do
timePartitions.Enqueue(RedeliverSet()) According to the Math, if you increase |
Having said that, I've just noticed, that you might see 30s because of this configuration. And it was removed in Java at some point, so you can create a PR with applying this improvement to Pulsar.Client as well. |
There seems to be a correlation between the ack timeout and memory allocation. The longer I set it, the more memory gets allocated.
Here you can see the allocations if the timeout is set to 100 days, but the problem is visible for smaller ack timeouts as well.
You can use the program bellow to reproduce the issue:
The text was updated successfully, but these errors were encountered: