Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add JVM options in Tomcat

Tags:

jvm

tomcat

How can I add jvm(Java virtual machine) options in Apache Tomcat 6?

Is there a administration console in tomcat? I tried http://localhost:8080/admin but I could not get anything out of it.

I want to add the following jvm options:

-agentpath:C:\calltracer\jvmti\calltracer5.dll=traceFile-C:\calltracer\call.trace,filterFile-C:\calltracer\filters.txt,outputType-xml,usage-uncontrolled -Djava.library.path=C:\calltracer\jvmti -Dcalltracerlib=calltracer5 
like image 590
pavan Avatar asked Oct 12 '11 10:10

pavan


People also ask

Where do I put JVM options?

To update JVM options manually for an MSI installation: jvmoptions file. For an MSI distribution the file is located in the %programdata%\JetBrains\YouTrack\conf directory. Edit the JVM options directly in the file.

Does Tomcat contain JVM?

Apache Tomcat is a Java servlet container, and is run on a Java Virtual Machine, or JVM. Tomcat utilizes the Java servlet specification to execute servlets generated by requests, often with the help of JSP pages, allowing dynamic content to be generated much more efficiently than with a CGI script.


Video Answer


1 Answers

As Bhavik Shah says, you can do it in JAVA_OPTS, but the recommended way (as per catalina.sh) is to use CATALINA_OPTS:

#   CATALINA_OPTS   (Optional) Java runtime options used when the "start", #                   "run" or "debug" command is executed. #                   Include here and not in JAVA_OPTS all options, that should #                   only be used by Tomcat itself, not by the stop process, #                   the version command etc. #                   Examples are heap size, GC logging, JMX ports etc.  #   JAVA_OPTS       (Optional) Java runtime options used when any command #                   is executed. #                   Include here and not in CATALINA_OPTS all options, that #                   should be used by Tomcat and also by the stop process, #                   the version command etc. #                   Most options should go into CATALINA_OPTS. 
like image 157
Mitch1077487 Avatar answered Oct 13 '22 05:10

Mitch1077487