Changes for page Tomcat Installation

Last modified by Thomas Mortagne on 2024/04/15

From version 21.1
edited by Vincent Massol
on 2013/06/13
Change comment: There is no comment for this version
To version 22.1
edited by Vincent Massol
on 2013/08/01
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -139,18 +139,18 @@
139 139  
140 140  == Out Of Memory Error ==
141 141  
142 -When you run XWiki in Tomcat with the default settings, you may get an ##Out Of Memory## error (##java.lang.OutOfMemoryError: Java heap space## or ##java.lang.OutOfMemoryError: PermGen space##), especially if you're trying to import large files into your wiki. To solve this allocate more memory to the JVM. For Tomcat this can be done by setting the ##JAVA_OPTS## environment property (to allocate 1GB you would set ##JAVA_OPTS## to ##-Xmx1g##). Another important option is the ##MaxPermSize## parameter. Example: ##-XX:MaxPermSize=512m## allocates 512MB of permanent memory.
142 +When you run XWiki in Tomcat with the default settings, you'll probably get an ##Out Of Memory## error (##java.lang.OutOfMemoryError: Java heap space## or ##java.lang.OutOfMemoryError: PermGen space##) since the default Tomcat memory settings are not enough for [[XWiki Memory Requirements>>platform:AdminGuide.Performances#HMemory]]. You'll need to allocate more memory to the JVM.
143 143  
144 -Memory recommendations are available in the [[Performance guide>>platform:AdminGuide.Performances#HMemory]].
144 +One easy solution to configure Tomcat's memory is to create a ##setenv.sh## file (or ##setenv.bat on Windows) in ##[TOMCAT_HOME]/bin/## (where ##[TOMCAT_HOME]## is where you've installed Tomcat) and inside this file add the following (adjust the memory values according to the [[XWiki Memory Requirements>>platform:AdminGuide.Performances#HMemory]]):
145 145  
146 -On most Linux distributions, setting the Java memory can be done in ##/etc/tomcat//X///tomcat//X//.conf## or ##/etc/conf.d/tomcat//X//.conf## (where //X// is the version of Tomcat installed):
147 -
148 148  {{code language="none"}}
149 -JAVA_OPTS="${JAVA_OPTS} -Xmx800m -XX:MaxPermSize=192m"
147 +CATALINA_OPTS="-Xmx800m -XX:MaxPermSize=192m"
150 150  {{/code}}
151 151  
152 -On Windows, if you are running Tomcat as a service then defining ##JAVA_OPTS## will not help. There is an utility provided in the ##bin## folder of your Tomcat installation (for example for Tomcat 5.x on Windows it's called tomcat5w.exe). It's a GUI tool which can be used to set various options including the heap size.
150 +On most Linux distributions, this can also be achieved in ##/etc/tomcat//X///tomcat//X//.conf## or ##/etc/conf.d/tomcat//X//.conf## (where //X// is the version of Tomcat installed).
153 153  
152 +On Windows, if you are running Tomcat as a service then defining ##CATALINA_OPTS## will not help. There is an utility provided in the ##bin## folder of your Tomcat installation (for example for Tomcat 5.x on Windows it's called tomcat5w.exe). It's a GUI tool which can be used to set various options including the heap size.
153 +
154 154  == Java Security Manager ==
155 155  
156 156  By default Tomcat is configured to have the Java Security Manager turned on. See the [[sample policy file>>AdminGuide.InstallationWAR#HInstallandconfigureaServletContainer]] for more details.

Get Connected