Out of memory java Heap Space on broker during message processing
Issue
Fuse log showing OutOfMemory at different timestamp from AMQ.logs
Caused by: javax.jms.JMSException: Java heap space
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:54)
at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1419)
at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1345)
at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1904)
at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:289)
at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:224)
at org.apache.activemq.jms.pool.PooledProducer.send(PooledProducer.java:95)
at org.apache.activemq.jms.pool.PooledProducer.send(PooledProducer.java:66)
at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:592)
at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSend(JmsConfiguration.java:337)
at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSendToDestination(JmsConfiguration.java:276)
at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.access$100(JmsConfiguration.java:218)
at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate$1.doInJms(JmsConfiguration.java:232)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:466)
... 43 more
Caused by: java.lang.OutOfMemoryError: Java heap space
at org.apache.activemq.util.DataByteArrayOutputStream.ensureEnoughBuffer(DataByteArrayOutputStream.java:249)
at org.apache.activemq.util.DataByteArrayOutputStream.writeBoolean(DataByteArrayOutputStream.java:140)
at org.apache.activemq.openwire.v6.BaseDataStreamMarshaller.looseMarshalByteSequence(BaseDataStreamMarshaller.java:628)
at org.apache.activemq.openwire.v6.MessageMarshaller.looseMarshal(MessageMarshaller.java:296)
at org.apache.activemq.openwire.v6.ActiveMQMessageMarshaller.looseMarshal(ActiveMQMessageMarshaller.java:111)
I'm interested in the mechanism of the memoryLimit attribute, particularly in context of using persistent storage.
Does this mean that every queue will use up to memoryLimit before messages are written to disk?
Or does it mean that it can use up to memoryLimit, and it will introduce flow control until it's able to write messages beyond that to disk?
Would it be advisable to increase the memoryLimit on the default queues? What would be the impact of removing that limit?
Environment
- JBoss A-MQ
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
