You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Timothy Bish (JIRA)" <ji...@apache.org> on 2013/09/10 22:47:54 UTC
[jira] [Closed] (AMQ-4715) Memory issue with ActiveMQ in java
[ https://issues.apache.org/jira/browse/AMQ-4715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Timothy Bish closed AMQ-4715.
-----------------------------
Resolution: Not A Problem
Shutting this down as its not an AMQ issue. Move discussion to the mailing list please.
> Memory issue with ActiveMQ in java
> ----------------------------------
>
> Key: AMQ-4715
> URL: https://issues.apache.org/jira/browse/AMQ-4715
> Project: ActiveMQ
> Issue Type: Bug
> Affects Versions: 5.6.0, 5.7.0
> Reporter: ritesh
>
> Every time when i start connection and create session i can see “java.exe” (in task manger) memory get increase by 1000 to 2000K that’s ok.
> Now, when i closed connection and session expecting to memory go down by 1000 to 2000K but nothing happening.
> Here is my sample code.
> {code}
> public static void main(String[] args) {
> try {
> ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
> Connection connection= connectionFactory.createConnection();
> connection.start();
> for(int i=0;i<40;i++) {
> Session session= m_connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
> Destination queueDestination = session.createQueue("TestQueue");
> MessageProducer producer = session.createProducer(queueDestination);
> producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
> TextMessage textMessage = session.createTextMessage();
> textMessage.setText(“some text”);
> String jmsCorrelationId= UUID.randomUUID().toString();
> textMessage.setJMSCorrelationID(m_jmsCorrelationId);
> producer.send(textMessage);
> if (producer != null) {
> producer.close();
> producer=null;
> }
>
> if(m_session != null) {
> session.close();
> session=null;
> }
> } // end for loop
> if (connection!=null) {
> connection.close();
> }
> }
> }
> {code}
> If you will execute this program three to four times you will see significant memory get increase in task manger for “java.exe”.
> Thing most bothering me is that… after executing this program all allocated memory should get cleaned-up by GC but look like somehow it’s not happening.
> No idea what am I doing wrong?
> Please help me!
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira