Solved

Tomcat memory setting in windows

Posted on 2006-10-20
8
5,960 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
WLAN Microsoft NLB Conundrum 7 249
websphere  mq 7.1.0.3 create message queue 2 324
Choosing VM roles in Hyper-V 3 165
Tivoli 2 127
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 …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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