1

After installing Tomcat (on Ubuntu 18.04) via apt install tomcat8, where to put the Java -Xmx option to increase available memory?

Witek
  • 4,043

1 Answers1

-1

Set an environment variable CATALINA_OPTS (or JAVA_OPTS) into a script named setenv.sh, in CATALINA_BASE/bin.

From the 'catalina.sh':

Environment Variable Prerequisites

   Do not set the variables in this script. Instead put them into a script
   setenv.sh in CATALINA_BASE/bin to keep your customizations separate.

   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.

OR

   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.