Friday, February 20, 2009

Memory settings when using Jetty inside of Eclipse

If you like to debug and run your webapps inside of Eclipse you've got two options. First there is Tomcat, which running will require a plugin like Sysdeo. Second, you can write a simple class to start up your web application using Jetty. I like to use Jetty rather than the old school Sysdeo Tomcat plugin. I've found that it is simpler to configure the application to run in a test or stage mode this way inside of Eclipse.

If you run Jetty inside of Eclipse you may need to increase the memory being used by the process (Jetty is fast to start up and doesn't requires much memory, but your web app may!). So if you have a process to start your web app in Eclipse you'll have a run configuration. If you open this (click the item menu drop down to the right of the green circle w/ a triangle in it) configuration in the right pane select the 'Arguments' tab.

As you can see in the image above you then will want to fill in the VM arguments to contain the needed memory settings. In the above configuration I've added settings to increase the minimum heap to 256 mb and the max heap to 512 mb. Thats all I needed for my webapp to run smoothly, you may require more or less.

No comments: