To be precise, there is no such thing as a "topic" in ActiveMQ Artemis. The address model [1] consists of three basic elements - address, queue, and routing type. You can read about how a JMS topic maps onto these elements in the documentation [2].
Regarding when messages are dropped, what JB said is true. If there are no subscribers then messages are not routed anywhere and are dropped. If there are subscribers then messages are routed to the corresponding queue for that subscription and they remain there until the message is acknowledged or the subscription is destroyed. If you are seeing instance of org.apache.activemq.artemis.core.server.impl.QueueImpl in your heap dump whose messagesAcknowledged values are 0 then that means that either there is no consumer on the queue (e.g. a JMS durable subscription was created but the subscriber is not currently connected) or a consumer is connected but it isn't properly acknowledging the messages that it is receiving. I recommend you investigate what's going on with your consumer(s) and potentially configure a more conservative value for paging [3]. Justin [1] https://activemq.apache.org/components/artemis/documentation/latest/address-model.html#address-model [2] https://activemq.apache.org/components/artemis/documentation/latest/jms-core-mapping.html#mapping-jms-concepts-to-the-core-api [3] https://activemq.apache.org/components/artemis/documentation/latest/paging.html#paging On Thu, May 16, 2024 at 10:10 AM William Crowell <wcrow...@perforce.com.invalid> wrote: > Hi, > > When is a message dropped from memory on a topic? When it is acknowledged? > > I have 10 topics that I noticed that are occupying a large amount of heap > from Eclipse’s Memory Analysis Tool. I am not seeing any evidence of a > memory leak, but we have configured a paging policy for each one of these > topics to combat the issue. > > I noticed there is a messagesAcknowledged and messagesAcknowledged fields > on org.apache.activemq.artemis.core.server.impl.QueueImpl. > messagesAcknowledge is usually zero on these queues which take a lot of > heap. > > Regards, > > William Crowell > > > > > This e-mail may contain information that is privileged or confidential. If > you are not the intended recipient, please delete the e-mail and any > attachments and notify us immediately. > >