Bruce -
You don't say if the JVM is 32-bit or 64-bit, but assuming the latter:
1) By splitting the Heap in half between NewGen and PermGen, you are
leaving no room for OldGen, and I'm sure java is going to want to set
aside some space for OldGen.  So you are probably getting the error
because there is no room for the PermGen you requested.
2) According to Sun: "Since 1.4, MaxNewSize is computed as a function of
NewRatio. [1.3.1 Sparc: 32m; 1.3.1 x86: 2.5m.]" With a default ratio of
8 or 12 (depends), you are probably losing a lot to the OldGen.
3) Also according to Sun, I am seeing this note on most memory options:
"5.0 and newer: 64 bit VMs are scaled 30% larger"
Here's the link I found useful:
http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp
Jeff


-----Original Message-----
From: Bruce Wayne [mailto:chur...@gmail.com] 
Sent: Wednesday, September 16, 2009 6:49 AM
To: users@tomcat.apache.org
Subject: java.lang.OutOfMemoryError: PermGen space

Hello,

I am running Red Hat Linux 2.6.18-164.el5 #1 SMP  x86_64 x86_64 x86_64
GNU/Linux with Tomcat 6 as seen below:

# /opt/tomcat/bin/version.sh
Using CATALINA_BASE:   /opt/tomcat
Using CATALINA_HOME:   /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME:       /usr/java/jdk1.6.0_16
Server version: Apache Tomcat/6.0.20
Server built:   May 14 2009 01:13:50
Server number:  6.0.20.0
OS Name:        Linux
OS Version:     2.6.18-164.el5
Architecture:   amd64
JVM Version:    1.6.0_16-b01
JVM Vendor:     Sun Microsystems Inc.

My JAVA_OPTS are:
JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true -Dfile.encoding=UTF-8
-server
-Xms2048m -Xmx2048m -XX:NewSize=1024m -XX:MaxNewSize=1024m
-XX:PermSize=1024m -XX:MaxPermSize=1024m -XX:+DisableExplicitGC"

My system has 6GB of RAM.

I keep getting the following error:

java.lang.OutOfMemoryError: PermGen space
        java.lang.ClassLoader.defineClass1(Native Method)
        java.lang.ClassLoader.defineClass(ClassLoader.java:621)

        
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        java.net.URLClassLoader$1.run(URLClassLoader.java:195)

        java.security.AccessController.doPrivileged(Native Method)
        java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        java.lang.ClassLoader.loadClass(ClassLoader.java:252)

        java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.<init>(Lookup
Environment.java:87)
        
org.eclipse.jdt.internal.compiler.Compiler.<init>(Compiler.java:261)

        
org.eclipse.jdt.internal.compiler.Compiler.<init>(Compiler.java:153)
        
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:42
3)
        org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)

        org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
        org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
        
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja
va:586)
        
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:317)

        
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
        
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


Any help would be appreciated!

Thanks!

*******************************  NOTICE  *********************************
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to