You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
akka.stream.alpakka.jms.impl.JmsConsumerSession not accumulating in memory
Actual Behavior
akka.stream.alpakka.jms.impl.JmsConsumerSession are accumulating in memory because they are still referenced from jmsListener
Observations
At the begging the consumer sessions are added to a list (jmsSessions) in akka.stream.alpakka.jms.impl.JmsConnector#onSession. Additionally, it is referenced by anonymous jms.MessageListener created in akka.stream.alpakka.jms.impl.JmsTxSourceStageLogic.
Then I restart the MQ and akka.stream.alpakka.jms.impl.JmsConnector#handleRetriableException is called. That method cleans the list of the sessions, but they are still referenced from the listeners:
Then the MQ is back and new sessions are added to the list, but the old ones are still kept in memory and will never be garbage collected. The number of the sessions kept in memory grows with each connection lost with MQ.
Reproducible Test Case
Start an application with JmsConsumer.txSource that reads from MQ.
Restart the MQ.
The text was updated successfully, but these errors were encountered:
arcavire
changed the title
Alpakka JMS Consumer connection leak
Alpakka JMS Consumer memory leak
Nov 20, 2023
Versions used
Akka version: 2.6.18
Alpakka version: 4.0.0
Scala version: 2.13
IBM MQ AllClient version: 9.3.4.0
Expected Behavior
akka.stream.alpakka.jms.impl.JmsConsumerSession
not accumulating in memoryActual Behavior
akka.stream.alpakka.jms.impl.JmsConsumerSession
are accumulating in memory because they are still referenced from jmsListenerObservations
At the begging the consumer sessions are added to a list (
jmsSessions
) inakka.stream.alpakka.jms.impl.JmsConnector#onSession
. Additionally, it is referenced by anonymous jms.MessageListener created inakka.stream.alpakka.jms.impl.JmsTxSourceStageLogic
.Then I restart the MQ and
akka.stream.alpakka.jms.impl.JmsConnector#handleRetriableException
is called. That method cleans the list of the sessions, but they are still referenced from the listeners:Then the MQ is back and new sessions are added to the list, but the old ones are still kept in memory and will never be garbage collected. The number of the sessions kept in memory grows with each connection lost with MQ.
Reproducible Test Case
The text was updated successfully, but these errors were encountered: