PermGen Space out of memory

Hi all:

When trying to run my project I am getting the PermGen Space error shown below. I have tried this "fix" which was recommeneded to me previoiusly, but this doesn't seem to resolve it either.
I am running IJ12 and Tomcat 7.0.32

Here is the JAVA_OPTS I am using straight from the link provided above. Should I be using somethng higher that this?

JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms1536m
-Xmx1536m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m
-XX:MaxPermSize=256m -XX:+DisableExplicitGC"




Anyone else run into issues like this?

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 org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2904)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at org.springframework.ws.transport.http.CommonsHttpMessageSender.createConnection(CommonsHttpMessageSender.java:228)
at com.follett.fheg.ecommerce.onlineadoptions.net.OAHttpMessageSender.createConnection(OAHttpMessageSender.java:32)
at org.springframework.ws.client.support.WebServiceAccessor.createConnection(WebServiceAccessor.java:107)
at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:498)
at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:457)
at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:403)
at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:394)
at org.springframework.integration.ws.SimpleWebServiceOutboundGateway.doHandle(SimpleWebServiceOutboundGateway.java:69)
at org.springframework.integration.ws.AbstractWebServiceOutboundGateway.handleRequestMessage(AbstractWebServiceOutboundGateway.java:99)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:91)
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:59)
at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:103)

3 comments
Comment actions Permalink

I'd suggest you connect to your Tomcat process using a profiler or similar tool to examine (permgen) memory usage. You cannot really make guesses if the value is "high enough" without actually measuring it.

0
Comment actions Permalink

I'll take a look at it thanks for the direction.

0
Comment actions Permalink

I wanted to post this here in case anyone else needs help with this issue too.
It is easily fixed by adding  -XX:MaxPermSize=256m to the VM options in your Run Configuration (see attachment provided). After adding that the application now works perfectly.

For whatever reason my app runs fine in Eclipse STS. But, deploying the same app to the same server (Tomcat 7) using IJ12 I would get the PermGen error.
As I mentioned above I did try the fix to tomcat as the link I proivded suggests doing but that didnt' work either.

I still plan on using JProfiler or VisualVM as suggested though.



Attachment(s):
12-21-2012 11-48-31 AM.png
1

Please sign in to leave a comment.