JAVA_OPTS set to catalina.sh does not work for a private instance of TOMCAT

I placed the JVM options through JAVA_OPTS in the catalina.sh file in the catalina database. However, the system does not select these parameters - I am trying to transfer profiling information to set paths for project properties and file logging. I have to set the parameters in setenv.sh in a separate bin instance. Even the echo command that I put in catalina.sh to view JAVA_OPTS does not get printable defaults such as CATALINA_BASE, etc. type. Is .sh catalysis even being processed?

At the end of the day, my system works fine with setenv.sh. I am curious why JAVA_OPTS are not matched with catalina.sh.

I am using Ubuntu 12.04 with TOMCAT 7 and JDK 1.7 installed.

thank

+4
source share
3 answers

You should not edit the catalina.sh file - it is listed in this file. Instead, set your variables with smooth env , create the setenv.sh file in the same directory as Catalina.sh (CATALINA_BASE / bin) and write your code.

I had to set the JAVA_OPTS variable myself, and I created the bin / setenv.sh file, set it to executable chmod +x bin/setenv.shand wrote in it:

JAVA_OPTS = "$JAVA_OPTS -Xms128m -Xmx512m -server"

which set my initial allocated memory to 128 and the maximum memory to 512 MB. And he worked.

+6
source

edit: /etc/default/tomcat7or/etc/default/{user_who_runs_tomcat}

eg:.

*JAVA_OPTS="-Djava.awt.headless=true -Xmx2G -XX:+UseConcMarkSweepGC -server -XX:MaxPermSize=384m"*
+2
source

catalina.sh - , , , . setenv.sh , , : , tomcat - catalina.sh. , tomcat setenv.sh, .

, CATALINA_OPTS JAVA_OPTS: , tomcat. JAVA_OPTS="-Xmx16G -Xms16G", 16- tomcat. shutdown JVM JAVA_OPTS. CATALINA_OPTS ( JAVA_OPTS), , , /, tomcat - shutdown.sh.

+1

Source: https://habr.com/ru/post/1548252/


All Articles