您好,登錄后才能下訂單哦!
這篇文章主要介紹“Linux下Tomcat8怎么修改JVM內存配置”的相關知識,小編通過實際案例向大家展示操作過程,操作方法簡單快捷,實用性強,希望這篇“Linux下Tomcat8怎么修改JVM內存配置”文章能幫助大家解決問題。
Tomcat并不建議直接在catalina.sh里配置變量,而是寫在與catalina同級目錄(bin目錄)下的setenv.sh里。
那么我們就需要修改setenv.sh文件(默認沒有,需新建一個setenv.sh),寫入(大小根據自己情況修改):
export CATALINA_OPTS="$CATALINA_OPTS -Xms1000m" export CATALINA_OPTS="$CATALINA_OPTS -Xmx1000m" export CATALINA_OPTS="$CATALINA_OPTS -XX:MaxPermSize=256m"
你會發現:
cation directory [/usr/local/apache-tomcat-8.5.33/webapps/manager] has finished in [11] ms
06-Sep-2018 14:18:17.690 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8088"]
06-Sep-2018 14:18:17.702 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
06-Sep-2018 14:18:17.707 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 10577 ms
[INFO] Working directory is /usr/local/apache-tomcat-8.5.33
[INFO] War root is /usr/local/apache-tomcat-8.5.33/webapps/cat
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
06-Sep-2018 14:55:15.068 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.33
06-Sep-2018 14:55:15.073 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Aug 12 2018 08:20:08 UTC
06-Sep-2018 14:55:15.073 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.5.33.0
06-Sep-2018 14:55:15.073 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
06-Sep-2018 14:55:15.073 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 3.10.0-229.el7.x86_64
06-Sep-2018 14:55:15.073 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
06-Sep-2018 14:55:15.073 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/local/jdk1.8.0_171/jre
06-Sep-2018 14:55:15.073 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_171-b11
06-Sep-2018 14:55:15.073 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
06-Sep-2018 14:55:15.073 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/local/apache-tomcat-8.5.33
06-Sep-2018 14:55:15.073 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/local/apache-tomcat-8.5.33
06-Sep-2018 14:55:15.074 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/apache-tomcat-8.5.33/conf/logging.properties
06-Sep-2018 14:55:15.074 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
06-Sep-2018 14:55:15.074 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
06-Sep-2018 14:55:15.074 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
06-Sep-2018 14:55:15.074 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
06-Sep-2018 14:55:15.074 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms1000m
06-Sep-2018 14:55:15.074 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx1000m
06-Sep-2018 14:55:15.074 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:MaxPermSize=256m
06-Sep-2018 14:55:15.074 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
06-Sep-2018 14:55:15.074 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/apache-tomcat-8.5.33
06-Sep-2018 14:55:15.075 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/apache-tomcat-8.5.33
06-Sep-2018 14:55:15.075 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/apache-tomcat-8.5.33/temp
06-Sep-2018 14:55:15.075 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
06-Sep-2018 14:55:15.236 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8088"]
06-Sep-2018 14:55:15.248 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
06-Sep-2018 14:55:15.255 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
06-Sep-2018 14:55:15.257 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
06-Sep-2018 14:55:15.259 信息 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 602 ms
06-Sep-2018 14:55:15.302 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
06-Sep-2018 14:55:15.302 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.33
06-Sep-2018 14:55:15.327 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/local/apache-tomcat-8.5.33/webapps/cat.war]
06-Sep-2018 14:55:18.042 信息 [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
06-Sep-2018 14:55:33.944 警告 [localhost-startStop-1] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [15,876] milliseconds.
Logger file /data/applogs/cat/cat_20180906.log
[root@localhost bin]# ./startup.sh
Using CATALINA_BASE: /usr/local/apache-tomcat-8.5.33
Using CATALINA_HOME: /usr/local/apache-tomcat-8.5.33
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.5.33/temp
Using JRE_HOME: /usr/local/jdk1.8.0_171/jre
Using CLASSPATH: /usr/local/apache-tomcat-8.5.33/bin/bootstrap.jar:/usr/local/apache-tomcat-8.5.33/bin/tomcat-juli.jar
Tomcat started.
[root@localhost bin]# uname -a
Linux localhost.localdomain 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost bin]#
關于“Linux下Tomcat8怎么修改JVM內存配置”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識,可以關注億速云行業資訊頻道,小編每天都會為大家更新不同的知識點。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。