Am new to tomcat server. I need to configure the server.
Specification:
OS : Linux unknown, amd64/64 (8 cores)
RAM : 4GB
Server : Tomcat7
JAVA : OpenJDK Runtime Environment, 1.6.0_24-b24
JVM : OpenJDK 64-Bit Server VM, 20.0-b12, mixed mode
What are all the option i need give in setenv.sh file. Currently i give the option like below,
export CATALINA_OPTS="-Xms512M -Xmx1024M -XX:PermSize=64M
-XX:MaxPermSize=512M -XX:MaxNewSize=1024m
-XX:NewSize=1024m -XX:+UseParNewGC
-XX:TargetSurvivorRatio=90 -XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled -XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled -XX:+UseCMSInitiatingOccupancyOnly
-XX:CMSInitiatingOccupancyFraction=70
-XX:+ScavengeBeforeFullGC
-XX:+CMSScavengeBeforeRemark
-Dcom.sun.management.jmxremote.port=8999
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false"
These option are enough or i need modify or add any option. Till now am using default option(in default option server getting down after one day). please help me to configure production server.
If you are sure your web-app didn't generate that error, you could try to read this: Tomcat Wiki and then you can increase the PermGen
Related
I am using IntelliJ 2020.1 Ultimate and have a JBoss 7.0.2 server that I want to run from IntelliJ.
I have added it as a configuration:
But when I try start the server, I get the following error:
IDEA.app/Contents/plugins/Kotlin/lib/jps/kotlin-jps-plugin.jar:/Applications/IntelliJ
IDEA.app/Contents/plugins/Kotlin/lib/kotlin-stdlib.jar:/Applications/IntelliJ
IDEA.app/Contents/plugins/Kotlin/lib/kotlin-reflect.jar:/Applications/IntelliJ
IDEA.app/Contents/plugins/Kotlin/lib/kotlin-plugin.jar"
org.jetbrains.jps.cmdline.BuildMain 127.0.0.1 64088
4a7ed3b5-cfb6-4196-b997-396c16d8c06f
/Users/richardmarais/Library/Caches/JetBrains/IntelliJIdea2020.1/compile-server
Picked up JAVA_TOOL_OPTIONS: -Dhttps.protocols=TLSv1.2 -Xmx2048m
-XX:MaxPermSize=1024m -Xms2048m OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0 Error occurred
during initialization of VM Initial heap size set to a larger value
than the maximum heap size
My idea.vmoptions are the default values:
-Xms128m
-Xmx2048m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-XX:CICompilerCount=2
-Dsun.io.useCanonPrefixCache=false
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Djdk.attach.allowAttachSelf=true
-Dkotlinx.coroutines.debug=off
-Djdk.module.illegalAccess.silent=true
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8
-XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof
Question
Do you know how I can fix the above error to get JBoss to start?
You don't need to set any global environment variables to patch the VM options.
Unset JAVA_TOOL_OPTIONS and specify the proper VM Options in the Run/Debug configuration for the server:
-Xms256m -Xmx2048m -XX:MaxPermSize=512m
It should be more than enough for any project. I doubt that you really need 5GB initial heap size.
Also note that IntelliJ IDEA .vmoptions doesn't affect the options for the apps that you start from the IDE.
I fixed this by doing this.
open -a TextEdit.app ~/.bash_profile
then:
export JAVA_TOOL_OPTIONS="-Dhttps.protocols=TLSv1.2 -Xmx4096m -Xms128m"
I'm trying find a explanation about the usage of -server flag in the Weblogic Server start.
I don't find any documentation about if the -server should or if it is mandatory be the first argument of the Java Options.
Example:
java -server -Xms256m -Xmx512m
OR
java -Dweblogic.ProductionModeEnabled=true -server -Xms256m -Xmx512m
I'm sorry for the question but I have this question without a concrete answer.
For your scenario, it does not matter. It needs to be before "-jar filename" and any arguments. -server is an option, so just goes anywhere in the list of options which should appear before "-jar filename", as the documentation states, the format is:
java [options] classname [args]
java [options] -jar filename [args]
It should also be noted that the -server option is default in 64-bit (OpenJDK based) JVMs. This quote is from the same page:
-server
Selects the Java HotSpot Server VM. The 64-bit version of the JDK supports only the Server VM, so in that case the option is
implicit.
For default JVM selection, see Server-Class Machine Detection at
http://docs.oracle.com/javase/8/docs/technotes/guides/vm/server-class.html
I installed Tomcat 8 with Java 8 on VPS server with 1024 RAM. But when I deploy war package I get error for memory.
I tried to limit the allocated memory with this setenv.sh script:
#! /bin/sh
export JAVA_OPTS="-Djava.awt.headless=true -server -Xms48m -Xmx1024M -XX:MaxPermSize=512m
But I get this error when I start Tomcat:
[root#ip-172-31-28-148 bin]# ./shutdown.sh
Using CATALINA_BASE: /opt/apache-tomcat-8.0.26
Using CATALINA_HOME: /opt/apache-tomcat-8.0.26
Using CATALINA_TMPDIR: /opt/apache-tomcat-8.0.26/temp
Using JRE_HOME: /
Using CLASSPATH: /opt/apache-tomcat-8.0.26/bin/bootstrap.jar:/opt/apache-tomcat-8.0.26/bin/tomcat-juli.jar
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
[root#ip-172-31-28-148 bin]#
Do you have any idea what is the proper way to limit Java to use 512 MB RAM memory?
It's normal, the system property PermSize and MaxPermSize have been removed in Java8 and their use raise a warning.
You could use MaxMetaspaceSize instead but your question is not clear. With PermSize, your reduce the memory allocated to the Permanent Generation, objects which are needed by the JVM and your container at all time.
If you want to reduce the memory used by your JVM (only the heap --> arrays and instances), you should use Xms (size at start) and Xmx (max size).
For example :
-Xms256M
-Xmx1024M
I'm using Mac OSX 10.9 and Intellij Idea 13 on a decked out machine (7i processor, 16GB RAM, 64 bit, etc.). I have things working well; however, it seems to me that Intellij is running pretty slow (approx. 5 mins to boot up, almost a full 2 minutes to compile a system out print line class, etc.). As a frame of reference I have looked through numerous posts and have landed on the configurations below. My question is this. Does anyone else use a similar set up and have it running quicker? If so, what modifications have you made to your environment to speed things up. Thanks in advance for any help.
Java Version:
Switched from jdk1.6 to jdk1.7
idea.vmoptions:
-ea
-server
-Xms1g
-Xmx1g
-Xss16m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+DoEscapeAnalysis
-XX:+UseCompressedOops
-XX:+UnlockExperimentalVMOptions
-XX:+UseConcMarkSweepGC
-XX:LargePageSizeInBytes=256m
-XX:ReservedCodeCacheSize=96m
-XX:+UseCodeCacheFlushing
-XX:+UseCompressedOops
-XX:ParallelGCThreads=8
-XX:+UseParNewGC
-XX:+UseConcMarkSweepGC
-XX:+DisableExplicitGC
-XX:+ExplicitGCInvokesConcurrent
-XX:+PrintGCDetails
-XX:+PrintFlagsFinal
-XX:+AggressiveOpts
-XX:+HeapDumpOnOutOfMemoryError
-XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled
-XX:CMSInitiatingOccupancyFraction=60
-XX:+CMSClassUnloadingEnabled
-XX:+CMSParallelRemarkEnabled
-XX:+UseAdaptiveGCBoundary
-XX:+UseSplitVerifier
-XX:CompileThreshold=10000
-XX:+UseCompressedStrings
-XX:+OptimizeStringConcat
-XX:+UseStringCache
-XX:+UseFastAccessorMethods
-XX:+UnlockDiagnosticVMOptions
info.plist (modification):
<key>LSArchitecturePriority</key>
<array>
<string>x86_64</string>
</array>
<key>JVMVersion</key>
<string>1.7*</string>
I strongly suggest you not to use all these VM options (especially those controlling garbage collector) unless you actually measure they will improve performance.
Please report reproducable performance problems as described here https://intellij-support.jetbrains.com/entries/29983118-Reporting-performance-problems
Here's the scoop. There is a lot of stuff out there about changing the heap size, garbage collectors and what not. It may not be the root cause of your problem. Be sure to understand what you are setting in your vmoptions file as several suggestions aren't really supported any longer. I worked with the folks at IntelliJ going back and forth with log files and what not and it boils down to this. Check your anti virus. After adjusting my anti-virus, the following settings have IntelliJ screaming. Please note that this was the cause to my individual problem; so be sure to check your log files because that is where I started to find answers.
JDK 1.6
.vmoptions is running in the /Application/IntelliJ13/bin:
-Xms128m
-Xmx750m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=96m
-XX:+UseCompressedOops
*notice that you don't need to allocate huge amounts of system resources. If you set up your system correctly it isn't needed.
Idea.plist:
<key>LSArchitecturePriority</key>
<array>
<string>x86_64</string>
<string>i386</string>
</array>
<key>JVMVersion</key>
<string>1.6*</string>
I know it is simple but it works.
I received OutOfMemoryError: PermGen space error.
I run tomcat using command:
/usr/local/etc/rc.d/tomcat7 start
I am trying to increase PermGen space (JAVA_OPTS="-XX:PermSize=256m -XX:MaxPermSize=256m").
I tried to add this string to next places:
catalina.sh
startup.sh
setenv.sh
tomcat7(/usr/local/etc/rc.d/)
But it is no effect. Default Tomcat server status (/manager/status) shows that only 82MB allowed for PS Perm Gen.
What I did wrong?
OS Name: FreeBSD
OS Version: 9.1-STABLE
# java -version
openjdk version "1.7.0_21"
OpenJDK Runtime Environment (build 1.7.0_21-b11)
OpenJDK 64-Bit Server VM (build 23.21-b01, mixed mode)
What helped me:
In the tomcat7(/usr/local/etc/rc.d/):
tomcat7_java_opts="-XX:PermSize=256m -XX:MaxPermSize=256m"
I suspect that the server process on the machine is not picking up right Java OPTS.
Please try to find the process on the server and check the parameters being passed.
In Linux, its usually be
ps -ef | grep tomcat
or ps -ef | grep java
to find out the process and verify the JVM parameters.
Edit 1: the is a sample output of the command to find process, which might indicate the java opt parameter values:
local-vm-1 [5]:ps -ef | grep tomcat
tomcat 4141 1 0 07:38 ? 00:01:33 /apps/mw/jdk/1.6.0.17-64bit/bin/java -Dnop -Xms1024m -Xmx1024m -server -DTC=testplatform -DWMC_ENV
=test -XX:MaxNewSize=112m -XX:NewSize=112m -XX:SurvivorRatio=6 -XX:PermSize=256m -XX:MaxPermSize=256m -Dsun.net.inetaddr.ttl=0 -DLISTEN_ADDRESS=wsx
-test-vm-dtcp-1.managed.com -Djavax.net.ssl.trustStore=/tech/tomcat/props/ldapstore.ts -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxre
mote.host=wsx-test-vm-dtcp-1 -Dcom.sun.management.jmxremote.port=25000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.auth
enticate=true -Dcom.sun.management.jmxremote.password.file=/tech/tomcat/props/jr-password.properties -Dcom.sun.management.jmxremote.access.file=/tec
h/tomcat/props/jr-access.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/tech/tomcat/apache-tomca
t-7.0.16/endorsed -classpath /tech/tomcat/apache-tomcat-7.0.16/bin/bootstrap.jar:/tech/tomcat/apache-tomcat-7.0.16/bin/tomcat-juli.jar -Dcatalina.ba
se=/tech/tomcat/instances/testplatform -Dcatalina.home=/tech/tomcat/apache-tomcat-7.0.16 -Djava.io.tmpdir=/tech/tomcat/instances/testplatform/te
mp org.apache.catalina.startup.Bootstrap start