Details
-
Question
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.6
Description
The consumer consumes large quantities of messages by using transactional session.After consuming a lot of messages, java heap memory is high.But java heap memory becomes lower when i kill all the consumer's connection.
Consumer code like this:
Session session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
MessageConsumer receiver = connection.createConsumer("test topic");
receiver.setMessageListener(new MessageListener()
);
apollo.xml:
<queue id="com.zqgame.activeMQ.visitRecords" dlq="dlq.*" nak_limit="1" swap_range_size="2000" auto_delete_after="0" />
<leveldb_store directory="${apollo.base}/data" read_threads="5" index_block_size="2048" index_cache_size="134217728" index_write_buffer_size="2097152" />
<connector id="tcp-max" bind="tcp://0.0.0.0:61614" connection_limit="100" protocol="openwire" send_buffer_size="4096" receive_buffer_size="4096"/>
About 30 connections(one consumer per one connection) consume 500-600 message per second.
GC infomation:
num #instances #bytes class name
----------------------------------------------
1: 623730 24949200 org.apache.activemq.apollo.openwire.command.MessageId
2: 311865 17464440 org.apache.activemq.apollo.openwire.command.MessageAck
3: 653593 15686232 org.apache.activemq.apollo.broker.Broker$PeriodStat
4: 624643 14991432 scala.collection.mutable.DefaultEntry
5: 76311 10419944 <constMethodKlass>
6: 76311 10389144 <methodKlass>
7: 312041 9985312 scala.collection.mutable.ListBuffer
8: 311865 9979680 org.apache.activemq.apollo.openwire.command.LocalTransactionId
9: 311865 9979680 org.apache.activemq.apollo.openwire.OpenwireProtocolHandler$TransactionContext
10: 7478 7530920 <constantPoolKlass>
11: 312847 7508328 scala.collection.immutable.$colon$colon
12: 311865 7484760 org.apache.activemq.apollo.openwire.OpenwireProtocolHandler$$anonfun$on_message_ack$1
JVM configuration:
-server -Xmx2G -Xms1G
apollo.xml and gc logs can see attachments.
What's wrong with my config or code?