Reputation: 41
We're getting the java.lang.OutOfMemoryError: PermGen space in our environment: Windows Server 2012 R2 64-bit 8GB RAM JRE 1.7 u80 Tomcat 7.0.73 ActiveMQ 5.9.0 Mule runtime 3.5.4 Mule management console 3.5.3 deployed over Tomcat 7 webservice war file that uses PhantomJS 1.9.8 deployed over Tomcat 7
setenv.bat file under Tomcat/bin folder with below settings: setenv JAVA_OPTS=-Xms512M -Xmx2048m -XX:PermSize=1024m -XX:MaxPermSize=1024m
Also, registry settings for JVM as under tomcat7w.exe: initial memory pool: 256 MB maximum memory pool: 1536 MB
Could any explain which takes precedence, setenv.bat file settings or tomcat7w.exe settings for memory pool? Also, what should be the ideal settings for this environment as these settings are currently running on windows server 2008 R2 64-bit with 16GB RAM?
Upvotes: 0
Views: 811
Reputation: 1
for ideal memory setting
Xms and Xmx should be equal ,
Inside catalina.bat JAVA_OPTS variable your should define the memory parameters.
while starting this will take the precedence.
take care
Upvotes: 0
Reputation: 719426
As @GKGeorgiev says, it will depend on how you are launching Tomcat.
I suggest you do a little experiment:
Change the max heap size settings in setenv.bat
to a value that is small enough to trigger an immediate failure.
Start Tomcat.
If this causes the behavior to change (e.g. to fail immediately) you know that the setenv.bat
file is the one that is taking precedence. If not, then not.
Then do the experiment the other way around; i.e. change the equivalent registry setting and see if that has any effect.
Also, check the Tomcat documentation that applies to the launch method you are using.
Finally, it would be advisable to upgrade to Java 8. Java 7 is well beyond its EOL, and running a Java version that is not getting security patches is risky.
Upvotes: 0
Reputation: 329
It depends how you start your Tomcat, whether you start it as windows service or via the catalina.bat.
You can check the following post: [question]: Configure Tomcat as a service (no catalina.bat)
Upvotes: 0