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

David Valeri commented on CAMEL-2740:
-------------------------------------

I have attached a screen shot showing memory usage for the attached test case.  
The attached test case uses a simple JUnit test to throw a bunch of small 
messages at JMS with the InOut MEP.  The test case uses the asynch capabilities 
of the ProducerTemplate to easily ramp up the traffic.  It doesn't wait for the 
generated Futures so it isn't really usable for correctness testing, it is just 
intended to reproduce the issue.  Also note that killing the build will likely 
not terminate the forked JVM.

It takes less than 8K messages to consume the available memory.  The test 
crawls along for a bit after this point and eventually runs out of memory and 
crashes somewhere in the low 8K message range.  It only takes a couple minutes 
to reach this point.  Based on real world observation, it would appear that the 
issue is not driven by message frequency but by message numbers.  That is, it 
can take a minute or a week to encounter enough messages, but eventually you 
run out of memory.

The heap is occupied mostly by character arrays that appear to contain message 
IDs / correlation IDs.  I did not traverse the object graph in the heap, but it 
would appear that there is some sort of issue with JMS filters or connections 
not getting cleaned up.  I did not attach the heap dump as it is trivial to 
generate from the attached test code.

Removing the replyTo URI parameter and using a temp destination for replies 
resolves the issue.  Memory usage stays in an acceptable range and message 
throughput is relatively constant, although does appear to slow slightly over 
time for a currently unknown reason.
                
> Using static queue as a reply queue in InOut pattern causes memory leak
> -----------------------------------------------------------------------
>
>                 Key: CAMEL-2740
>                 URL: https://issues.apache.org/jira/browse/CAMEL-2740
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jms
>    Affects Versions: 2.2.0
>         Environment: Originally reported on Windows 2003 server and recently 
> confirmed on OSX in a stand alone unit test.
>            Reporter: Qingyi Gu
>         Attachments: CAMEL-2740 Memory Usage.jpg, CAMEL-2740.tar.gz
>
>
> I am running JBoss, ActiveMQ and Camel for my application.   In the InOut 
> pattern,  I am using a predefined static queue as a reply queue.   After 
> running for a while,  the memory usage of JBoss keeps growing and growing 
> until it hits outOfMemory error and app server is totally hung.   I monitor 
> the thread in jconsole,  I can see the jms connection/session keeps growing 
> and growing.   
> But once I switch to use temp queue for InOut pattern,  this problem goes 
> away.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to