Shoothzj commented on pull request #12170: URL: https://github.com/apache/pulsar/pull/12170#issuecomment-926970610
> Could you explain why `clear()` could fix the memory exhausted problem? > > Generally, for OOM issues, I suggest a fail fast solution. Otherwise, there might be a memory leak somewhere. Agree. The return of `false` can achieve the goal of fast fail. Why `clear` is because `numMessagesInBatch` has been modified to 1, which make `BatchMessageContainerImpl` never allocate buffer again. We need a `clear()` or `numMessagesInBatch=0` -- 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]
