[ 
https://issues.apache.org/jira/browse/AMQ-4715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13766661#comment-13766661
 ] 

ritesh commented on AMQ-4715:
-----------------------------

Hi Jaromi,

        Can you please help me with following error.

Got following error form AMQ

ERROR | Memory Usage for the Broker (1024 mb) is more than the maximum
available
for the JVM: 981 mb.

I think i know the cause of an error. I have following setting in
"activemq.xml"

<systemUsage>
        <systemUsage>
        <memoryUsage>
                    <memoryUsage limit="1 gb"/> (here is the problem)
             </memoryUsage>
             <storeUsage>
                    <storeUsage limit="100 gb"/>
             </storeUsage>
             <tempUsage>
                    <tempUsage limit="50 gb"/>
             </tempUsage>
        </systemUsage>
</systemUsage>

Now, change it back to 64mb.
So, the question is since we are dealing with 9 to 10K (or some time 1MB)
size messages with delivery mode="NON_PERSISTENT" would it be a good idea to
increase this memory (to 2gb) if so, what would i have to do for JVM
memory(sorry we are new in java)?


One more thing in our application we have tons of temp and large string
objects would be good idea to use following command?

"-XX:+UseConcMarkSweepGC" first of all is it recommended to use this and if
so, where and how can i use this?

Tried on command prompt "c:program files\java">-XX:+UseConcMarkSweepGC didn’t
work.


Ritesh



                
> 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

Reply via email to