liangyepianzhou commented on code in PR #20326:
URL: https://github.com/apache/pulsar/pull/20326#discussion_r1213027445


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:
##########
@@ -1779,7 +1779,6 @@ long getNumIndividualDeletedEntriesToSkip(long 
numEntries) {
                 } finally {
                     if (r.lowerEndpoint() instanceof PositionImplRecyclable) {
                         ((PositionImplRecyclable) r.lowerEndpoint()).recycle();

Review Comment:
   We recycle an object after it is no longer used to save GC pause.
   But the upperEndpoint is still used after being recycled, which makes this 
issue.
   The lowerEndpoint is no longer used after being recycled, so we can recycle 
it.
   ```java
   state.startPosition = r.upperEndpoint();
   ```



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