jdfrozen opened a new issue, #21045:
URL: https://github.com/apache/pulsar/issues/21045

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) 
and found nothing similar.
   
   
   ### Version
   
   2.7.x
   
   ### Minimal reproduce step
   
   1、A large backlog of Key_Shared subscription messages
   2、The subscription has multiple consumers
   
   ### What did you expect to see?
   
   broker functioning
   
   ### What did you see instead?
   
   1、broker frequent gc
   2、broker fullgc
   3、broker OOM
   
   This is broker gc monitoring
   
![image](https://github.com/apache/pulsar/assets/32637573/5827efea-e819-4aeb-aad7-248d9555558b)
   
   Add parameters to the use of boot “-XX:+HeapDumpOnOutOfMemoryError”, When 
fullgc is sent, the analysis is done through mat
   <img width="1403" alt="image" 
src="https://github.com/apache/pulsar/assets/32637573/de8fb0f4-2418-458e-ac8d-c1af8509cb9a";>
   
   
   ### Anything else?
   
   Root cause: redeliveryMessages contains a large number of messages 
   
   PersistentStickyKeyDispatcherMultipleConsumers.java
   
       @Override
       protected synchronized Set<PositionImpl> getMessagesToReplayNow(int 
maxMessagesToRead) {
           if (isDispatcherStuckOnReplays) {
               // If we're stuck on replay, we want to move forward reading on 
the topic (until the overall max-unacked
               // messages kicks in), instead of keep replaying the same old 
messages, since the consumer that these
               // messages are routing to might be busy at the moment
               this.isDispatcherStuckOnReplays = false;
               return Collections.emptySet();
           } else {
               return super.getMessagesToReplayNow(maxMessagesToRead);
           }
       }
   
   
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


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