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
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
on 2013/08/01
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
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 intoyour wiki.Tosolve this allocatemoreemoryto theJVM. For Tomcathiscan bedoneby settingthe##JAVA_OPTS##environmentroperty (to allocate 1GB youwouldset ##JAVA_OPTS## to ##-Xmx1g##).Anotherimportant option is the#MaxPermSize## parameter.Example:##-XX:MaxPermSize=512m##allocates512MBof permanentmemory.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 recommendationsareavailable 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 youare running Tomcat asa servicethen defining##JAVA_OPTS## will notelp. Thereis anutility provided inthe##bin## folderof your Tomcatinstallation (for example for Tomcat5.xonWindowsit'scalled5w.exe). It's a GUI toolwhich can beusedtoset variousoptionsincludingthe 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.