Dear all,

We encounter a problem of java heap space using jms inOut and 
transferExchange=true option.

The origin of the memory leak is the InflightRepository in camel context to 
never dispose of any messages.


It occurs on consumer side with the following logic :

1. A message is receive through JMS, camel create an Exchange instance and add 
it to the context's inflightRepository.

2. The exchange received over JMS is parsed and used to set all the exchange 
value, including the exchangeId used as a key in inflightRepository. 
Unfortunately the inflightRepository key is not updated

3. When the route has finish its job it tries to dispose the message (probably 
using remove(Exchange) methods). But as the exchangeId in the Exchange is not 
the same as key store into InflightRepository, it is not removed.

4. After some time of execution (can be minutes or days regarding volume of 
data exchanged over JMS) the InflightRepository as eat all the heap memory 
space and it ends into a heap space error.


I created a small test case (in attachement) based on 
JmsInOutTransferExchangeTest from Jms Component on Github.
It passed successfully on 2.17.7 (version not failing we use in some of our 
apps), but fail with 2.21.x (version use in the new app).


Regards,

Bastien Meert

________________________________
Bastien Meert
Senior software engineer
Email : bastien.me...@mainsysgroup.com
Phone : +3210801120
Mobile : +32472702422

  <http://www.mainsysgroup.com/>  
[cid:logo2017_255_d2e2177c-199f-4081-ab38-122e21e1580f.jpg]

 www.mainsysgroup.com<http://www.mainsysgroup.com>
        [cid:line_84a61260-257c-4e2b-8224-4cb01bfd9911.jpg]

Head Office
Bastion Tower
Place du Champ de Mars 5 b21 Marsveldplein
B-1050 Bruxelles / Brussel
Phone. : +32 2 733 83 87
Enterprise N° : BE 0456.540.594


P Please consider the environment before printing this email


________________________________
This e-mail and its attachments may be confidential and are intended solely for 
the use of the individual to whom it is addressed. Any views or opinions 
expressed are solely those of the author and do not necessarily represent those 
of Mainsys. If you are not the intended recipient of this e-mail and its 
attachments, you must take no action based upon them, nor must you copy or show 
them to anyone. Please contact the sender if you believe you have received this 
e-mail in error.

Reply via email to