Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Tomcat 6 ready for continuous integration or how to get it work?

I'm looking for a hint how to make tomcat CI ready or an servlet container / application container which stand often redeploys like they happen when using hudson ci.

I experienced that Tomcat 6 does not properly undeploy webapps, leaving classes in jvm.

For example I monitored tomcat 6 with VisualVM: on start 2000 classes, on deploy of an app 3000 after redeploy 4000 and redeploy 5000 classes and so on - leading to crashes, memory leaks...

Okay hope one have a hint on tomcat and continuous-integration or other app servers.

like image 947
jpse Avatar asked Mar 12 '10 22:03

jpse


People also ask

What is Apache Tomcat 6?

Apache Tomcat version 6.0 implements the Servlet 2.5 and JavaServer Pages 2.1 specifications from the Java Community Process, and includes many additional features that make it a useful platform for developing and deploying web applications and web services.

How Tomcat is used in Devops?

Tomcat is an application server designed to execute Java servlets and render web pages that use Java Server page coding. Accessible as either a binary or a source code version, Tomcat's been used to power a wide range of applications and websites across the Internet.


2 Answers

Update : I've performed some tests with a moderately complex web application using Spring, Hibernate, GWT, C3P0 and HsqlDB.

Stock Tomcat 6.0.24 works just fine , provided you use the client compiler. It works on ten redeploys, whereas the server compiler breaks down on the fourth. I suggest you try with the -client flag.

Trying to debug the usage of the server compiler was fruitless, as the Eclipse MAT showed no GC roots for the classloaders, and yet they were retained. An oft-referenced bug , PermHeap bloat in and only in server VM was reportedly fixed in Java 6 update 16, but my tests fail with Java 6 update 16.


Tomcat has been checked and double-checked for such memory problems, and quite often the applications were to blame. No that is not to say that it's necessarily hard to have such a perm gen leak.

There are two possibilities here:

  • use the latest Tomcat 6.0.26 , which has recently received memory leak detection capabilities : basic memory leak detection was added to the standard Host implementation and exposed via JMX to detect memory leaks on web application reload. (markt/kkolinko)
  • embed the container and run using a container-per-application model. Tomcat, Jetty and Winstone are all well-suited for this.

If you actually want to debug this problem and make sure that it's Tomcat's fault, you can you the Eclipse memory analyser. They have a good blog post explaining how to debug PermGen problems.

like image 107
Robert Munteanu Avatar answered Sep 20 '22 16:09

Robert Munteanu


I always like to take drastic measures to make sure that everything is clean and in a fully reproducible state when starting

1) kill tomcat

2) delete it from disk

3) unzip a clean version

4) overwrite your personalized modified configured files

5) restart tomcat

6) deploy your app

like image 20
flybywire Avatar answered Sep 21 '22 16:09

flybywire