Search code examples
javaperformancejvmhotswaphotdeploy

What is the most efficient way to develop Java webapps? Or to be more specific, say Wicket apps?


this is my first time to post a question here, I will try to make my question as clear as possible.

I try to find a best process to develop Java webapps. After months of trial and error, my web development environment is made up by the following parts:

framework: Apache Wicket 1.4.16
IDE: eclipse Galileo, with m2eclipse plugin
Build Tools:Maven 2
Data Access: EclipseLink 2.1.1 via JPA 2.0(with StaticWeave)
RDBMS: MSSQL 2005 or above with jTDS
DI: Google Guice 2.0
developing web container: Jetty server embedded in Maven Jetty plugin.
Target web container: Tomcat 6.x or above

I use maven Jetty plugin to test run my webapps, enable JPDA while line precision tracing is required.

Whenever a change is made to the source codes, I have to reload my app to take effect. press ENTER to reload is ok, but after several times of reloads(about 3~5 depends on my PermGen settings), OutOfMemoryException is thrown, than I have to shut down and start up my app again. I know auto reload can be achieved by configuration, but it only leads to OOME faster(due to excess reloads).

After googling I realize that there are related to some memory leak problems. I've tried enlarge MaxPermSize settings, but RAM on my rig is limited, and it's not reasonable to set to something really big. BTW, Memory leak detection is introduced in Tomcat 7, and I found most memory leaks are from jTDS, Google Guice and Wicket itself, but I can do nothing about it.

Is there anything I can do accelerate my developing process? In order to reduce reload times should I move to a more advanced web container like Glassfish(sorry I can't afford a WebLogic or WebSphere here.) or anything.

Thanks in advance, any comments are welcome!


Solution

  • I use JRebel, it really helps a lot. I still have to restart the server now and then, but most changes just work. It's a perfect fit to a Java-centric framework like Wicket. You could also try DCEVM, if you can have a 'hacked' version of the JDK for development.