Question

I know there are many SO questions and answers on this issue; I have tried 8 or 10 different things that worked for other people, and feel in need of analysis of what's wrong rather than trial and error.

I am running on a Windows 64 bit machine, Spring Tool Suite 3.1, Jetty internal server. I am running one web application; its initial screen appears, I click on a link that performs an operation, it processes for perhaps 10 seconds, and then gives me the following

HTTP ERROR 500
Problem accessing /corrserv/printRoom/printManagement.html;jsessionid=uroykwoyxr2y.     
Reason: 

PermGen space

Caused by:
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:386)
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
at org.eclipse.jdt.internal.compiler.Compiler.<init>(Compiler.java:109)
at org.apache.jasper.compiler.JDTJavaCompiler.compile(JDTJavaCompiler.java:498)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:368)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:437)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:608)
at org.apache.jasper.servlet.JspServletWrapper.loadTagFile(JspServletWrapper.java:261)
at org.apache.jasper.compiler.TagFileProcessor.loadTagFile(TagFileProcessor.java:683)
at org.apache.jasper.compiler.TagFileProcessor.access$000(TagFileProcessor.java:88)
at org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:739)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1501)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2291)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2341)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2347)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:498)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2291)
at org.apache.jasper.compiler.TagFileProcessor.loadTagFiles(TagFileProcessor.java:757)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:222)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:435)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:608)


--------------------------------------------------------------------------------
Powered by Jetty://

The following is my STS.ini file:

-vm
C:/Program Files (x86)/Java/jdk1.6.0_43/bin/javaw.exe
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120522-1813
-product
org.springsource.sts.ide
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
512m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms256m
-Xmx512m
-XX:MaxPermSize=512m

I have tried many things for the last three values. I have put in 123456789m to ensure that STS reads this particular file (it won't start with that value). I am only running one web application. I used to have -XX:PermSize as well, will be happy to try that again. It is unfortunate that I don't know how these interact; only their basic meanings.

I would appreciate some guidance on how to solve this, or at least how to attack it.

Was it helpful?

Solution

This is can be resolved by looking at the version (bit version) of JDK. like a 32-bit application using a 64-bit JDK version. Change to the correct JDK version and the correct JRE.

OTHER TIPS

The problem appears to be in the jsp itself. I would guess it is filling up PermGen with classes. Can you post the jsp code?

Adding memory isn't the fix to this. There is something filling it and you need to find that something.

1) Limiting MaxPermSize to 512m probably isn't a good idea. I would definitely take it out.

2) It couldn't hurt to consider increasing -Xmx.

3) Here are some good links:

4) The most important thing is to profile your app as it's running to see if you can figure out exactly what is consuming your PermGen. Here are some options:

Maybe i am wrong, but the issue seems related to an incorret use of Jasper... have you investigated the accepted resone to OutOfMemoryError: PermGen Space -- Jasper Report with Spring running on Tomcat ?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top