Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set JVM options for Tomcat instance executed from eclipse

I'm developing a Java/Spring/Hibernate application with eclipse which is deployed to tomcat and I'm having serious java.lang.OutOfMemoryError: GC overhead limit exceeded issues.

I want to try to tweak the JVM settings used by the tomcat instance used by eclipse when launching the application.

Do you know how can I set the JVM tomcat parameters from eclipse? +1 if you know which files are affected.

I'm using tomcat 7.0.12, installed from a tar archive on a Linux machine.

I googled for hours but I couldn't find a working solution, TIA.

like image 264
NoUserFound Avatar asked May 14 '14 12:05

NoUserFound


2 Answers

enter image description hereUnder the 'server' view you will see the tomcat server instance listed.

Double click on it. This will open up a page in eclipse having server details. There is a link there called 'Open launch configuration'.

Click on that link and it will give you a dialog window. In that dialog window, under 'arguments' tab under vm arguments you can pass VM args

like image 66
Dev Blanked Avatar answered Oct 06 '22 01:10

Dev Blanked


specify the parameters that are you used by your catalina start up script, found here

tomcat_home/bin

it will use setenv script. Located in catalina_base. You can then add in there :

export JAVA_OPTS="-server -Xmx768m"

or for windows

set JAVA_OPTS=-server -Xmx768m
like image 36
NimChimpsky Avatar answered Oct 06 '22 01:10

NimChimpsky