Solved

Tomcat memory setting in windows

Posted on 2006-10-20
8
5,961 Views
Last Modified: 2010-05-18
w2k, and tomcat 5.5. the server has 4 GB RAM.  JVM/Tomcat set to use 1048 MB, and I still gets:
Oct 20, 2006 10:49:19 AM org.apache.tomcat.util.threads.ThreadPool$ControlRunnable run
SEVERE: Caught exception (java.lang.OutOfMemoryError: PermGen space) executing org.apache.tomcat.util.net.LeaderFollowerWorkerThread@159611, terminating thread
Oct 20, 2006 10:49:19 AM org.apache.tomcat.util.threads.ThreadPool$ControlRunnable run
SEVERE: Caught exception (java.lang.OutOfMemoryError: PermGen space) executing org.apache.tomcat.util.net.LeaderFollowerWorkerThread@159611, terminating thread
Oct 20, 2006 10:59:18 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080

how much windows allow Java/Tomcat to get RAM?  how can get exact RAM size needed for Tomcat

Thanks
0
Comment
Question by:salasadi
8 Comments
 
LVL 9

Accepted Solution

by:
shinobun earned 25 total points
ID: 17777976
You need to increase the PermGen size.  Add the following to the JAVA_OPTS or CATALINA_OPTS environment variable.

-XX:MaxPermSize=128m

http://java.sun.com/docs/hotspot/VMOptions.html#additional
0
 
LVL 3

Assisted Solution

by:KnightFire
KnightFire earned 25 total points
ID: 17787219
As shinobun has pointed out, you need to increase your perm space.
Perm space is the space that the VM uses to store objects that do not have a representation at the java level, for example, class defenitions etc. It is not part of the java heap (set using -mx etc) and needs to be set separately.

I can reccomend reading suns docs on garbage collection to get an understanding of how memory works.
http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html
0
 

Author Comment

by:salasadi
ID: 17787676
Thanks guys,
in tomcat 5 you can set the parameter from admin console for JVM and I set it toi 1 GB.  in older TC we used to do thios in registry.
0
 
LVL 9

Expert Comment

by:shinobun
ID: 18045592
Is your problem solved?  Have you tried our recommendations?

As KnightFire said, perm space is different from the heap size, and this might not be affected by the admin console.
0
 

Expert Comment

by:pensamex
ID: 22513939
This command is good or bad ?

JAVA_OPTS=$JAVA_OPTS -Xms64m -Xms512m -Xmx128m -Xmx512m -XX:PermSize=128m -XX:PermSize=256m
export JAVA_HOME="/usr/java/jdk1.5.0_04/"
export PATH=$PATH:$JAVA_HOME/bin
export CATALINA_HOME="/usr/local/apache-tomcat-5.5.20"
export TOMCAT_HOME="/usr/local/apache-tomcat-5.5.20"
export CLASSPATH=.
 
JAVA_OPTS=$JAVA_OPTS -Xms64m -Xms512m -Xmx128m -Xmx512m -XX:PermSize=128m -XX:PermSize=256m
 
/usr/local/apache-tomcat-5.5.20/bin/catalina.sh start

Open in new window

0

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
wmware 10 334
how to use external config file with Spring MVC 4 128
jboss wildfly 10.1 10 241
Review of OCA certificate policy 1 29
Convert websphere application server default chained Certificates from 1024 to 2048 keysize or higher size and also you can change signatureAlgorithm . Please make sure Websphere Application Server fixpack 7.0.0.23 or Above. The following steps a…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question