Solved

Tomcat memory setting in windows

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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 …
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now