Dries Harnie created ARTEMIS-4192:
-------------------------------------

             Summary: Calling removeAllMessages for a large paged queue causes 
OOM situation
                 Key: ARTEMIS-4192
                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4192
             Project: ActiveMQ Artemis
          Issue Type: Bug
          Components: Broker
    Affects Versions: 2.28.0, 2.27.0
            Reporter: Dries Harnie
         Attachments: image-2023-03-03-00-09-50-092.png

Steps to reproduce:
 # Create a broker from default settings
 # Add the following to broker.xml to enable paging for the TEST queue.
{{<address-setting match="TEST">}}
{{  <max-size-messages>25000</max-size-messages>}}
{{</address-setting>}}
 # Use {{artemis producer}} to dump 2 million messages into the TEST queue
{{./bin/artemis producer --message-count 20000 --threads 100}}
 # Call removeAllMessages using the console or via Jolokia:
{{curl -sH "Origin: http://localhost:8161"; -u admin:admin 
'[http://localhost:8161/console/jolokia/exec/org.apache.activemq.artemis:broker=!%220.0.0.0!%22,component=addresses,address=!%22TEST!%22,subcomponent=queues,routing-type=!%22anycast!%22,queue=!%22TEST!%22/removeAllMessages()']}}

The broker will start producing Java Heap space errors and shutdown.

I managed to take a heap dump and I noticed there are quite a few Artemis 
classes with an instance count of around one million, and then several more 
around 20,000. I included the latter because messages seem to be bundled into 
transactions of 500.

!image-2023-03-03-00-09-50-092.png!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to