You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Juan Pablo Converso <jp...@gmail.com> on 2015/05/28 01:14:59 UTC

Camel with Tomcat (with or without Spring) doesn't release memory after Stop Restart or Redeployment

Dear Camel Experts,

I'm having a problem using camel with tomcat as the container. For some
reason after several stop/restarts or redeployments the application generate
a java.lang.OutOfMemoryError And I need to restart tomcat

I tried to simplify the problem and discover the same behavior using the
examples in the official release package. Mainly I downloaded:
http://www.apache.org/dyn/closer.cgi/camel/apache-camel/2.15.2/apache-camel-2.15.2.tar.gz

And generated the WARs using mvn install for the following examples:
 - camel-example-servlet-tomcat-no-spring
 - camel-example-servlet-tomcat

Then deployed any of the WARs generated to tomcat: 7.0.55.

So when I open the tomcat manager and click the button stop, the application
stop gracefully but when I click the button "Find Leaks", tomcat manager
displays the following: 

The following web applications were stopped (reloaded, undeployed), but
their
classes from previous runs are still loaded in memory, thus causing a memory
leak (use a profiler to confirm):
/camel-example-servlet-tomcat-no-spring-2.15.2


I also verified the same behaviour using a profiler, when start and then
stop is clicked several times the application generates and the OutOfMemory
error and tomcat needs to be restarted

Thanks in advance for any help or guidance! 
 Best Regards
   Juan Pablo







--
View this message in context: http://camel.465427.n5.nabble.com/Camel-with-Tomcat-with-or-without-Spring-doesn-t-release-memory-after-Stop-Restart-or-Redeployment-tp5767577.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel with Tomcat (with or without Spring) doesn't release memory after Stop Restart or Redeployment

Posted by Juan Pablo Converso <jp...@gmail.com>.
Dear Christian,

Thanks for the response!

I tried to upload the file from here but it was too large. I created a tgz
file here ->
https://drive.google.com/file/d/0B_7I8JR0jolUWk5GdlpveTZqbm8/view?usp=sharing
The uncompressed file is about 30Mbytes

Mainly the war that I deployed to tomcat was created from the example:
apache-camel-2.15.2/examples/camel-example-servlet-tomcat-no-spring 
(provided by the official download package) using mvn install command)

Also If you need it here is the war created:

camel-example-servlet-tomcat-no-spring-2.war
<http://camel.465427.n5.nabble.com/file/n5767613/camel-example-servlet-tomcat-no-spring-2.war>  

Best Regards
 Juan Pablo





--
View this message in context: http://camel.465427.n5.nabble.com/Camel-with-Tomcat-with-or-without-Spring-doesn-t-release-memory-after-Stop-Restart-or-Redeployment-tp5767577p5767613.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel with Tomcat (with or without Spring) doesn't release memory after Stop Restart or Redeployment

Posted by Christian Müller <ch...@gmail.com>.
Can you provide a heap dump so that we can have a look which classes are
not unloaded!?

Best,

Christian
-----------------

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642

On Thu, May 28, 2015 at 1:14 AM, Juan Pablo Converso <jp...@gmail.com>
wrote:

> Dear Camel Experts,
>
> I'm having a problem using camel with tomcat as the container. For some
> reason after several stop/restarts or redeployments the application
> generate
> a java.lang.OutOfMemoryError And I need to restart tomcat
>
> I tried to simplify the problem and discover the same behavior using the
> examples in the official release package. Mainly I downloaded:
>
> http://www.apache.org/dyn/closer.cgi/camel/apache-camel/2.15.2/apache-camel-2.15.2.tar.gz
>
> And generated the WARs using mvn install for the following examples:
>  - camel-example-servlet-tomcat-no-spring
>  - camel-example-servlet-tomcat
>
> Then deployed any of the WARs generated to tomcat: 7.0.55.
>
> So when I open the tomcat manager and click the button stop, the
> application
> stop gracefully but when I click the button "Find Leaks", tomcat manager
> displays the following:
>
> The following web applications were stopped (reloaded, undeployed), but
> their
> classes from previous runs are still loaded in memory, thus causing a
> memory
> leak (use a profiler to confirm):
> /camel-example-servlet-tomcat-no-spring-2.15.2
>
>
> I also verified the same behaviour using a profiler, when start and then
> stop is clicked several times the application generates and the OutOfMemory
> error and tomcat needs to be restarted
>
> Thanks in advance for any help or guidance!
>  Best Regards
>    Juan Pablo
>
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-with-Tomcat-with-or-without-Spring-doesn-t-release-memory-after-Stop-Restart-or-Redeployment-tp5767577.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>