Results 1 to 5 of 5

Thread: OutOfMemoryError: PermGen space

  1. #1
    Join Date
    Feb 2008
    Location
    Dublin - Ireland
    Posts
    102

    Default OutOfMemoryError: PermGen space

    Hello:

    I'm getting this error when using a request/reply message, I don't have a clue about it, does someone had a similar problem?

    TIA..


    10:19:35,096 WARN [MessagePublishingErrorHandler] failure occurred in messaging task
    org.springframework.integration.MessagingException : Method 'execute' threw exception
    at org.springframework.integration.util.SimpleMethodI nvoker.invokeMethod(SimpleMethodInvoker.java:65)
    at org.springframework.integration.handler.DefaultMes sageHandlerAdapter.doHandle(DefaultMessageHandlerA dapter.java:52)
    at org.springframework.integration.handler.AbstractMe ssageHandlerAdapter.handle(AbstractMessageHandlerA dapter.java:91)
    at org.springframework.integration.endpoint.DefaultMe ssageEndpoint.handle(DefaultMessageEndpoint.java:2 62)
    at org.springframework.integration.dispatcher.Default MessageDistributor.distribute(DefaultMessageDistri butor.java:89)
    at org.springframework.integration.dispatcher.Default MessageDispatcher.doDispatch(DefaultMessageDispatc her.java:183)
    at org.springframework.integration.dispatcher.Default MessageDispatcher.access$2(DefaultMessageDispatche r.java:176)
    at org.springframework.integration.dispatcher.Default MessageDispatcher$DispatcherTask.run(DefaultMessag eDispatcher.java:217)
    at org.springframework.integration.scheduling.SimpleM essagingTaskScheduler$MessagingTaskRunner.run(Simp leMessagingTaskScheduler.java:136)
    at java.util.concurrent.Executors$RunnableAdapter.cal l(Executors.java:417)
    at java.util.concurrent.FutureTask$Sync.innerRunAndRe set(FutureTask.java:280)
    at java.util.concurrent.FutureTask.runAndReset(Future Task.java:135)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.access$101(ScheduledThreadPoolE xecutor.java:65)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.runPeriodic(ScheduledThreadPool Executor.java:142)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.run(ScheduledThreadPoolExecutor .java:166)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:650)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:675)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.OutOfMemoryError: PermGen space
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :620)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:124)
    at org.apache.catalina.loader.WebappClassLoader.findC lassInternal(WebappClassLoader.java:1814)
    at org.apache.catalina.loader.WebappClassLoader.findC lass(WebappClassLoader.java:872)
    at org.jboss.web.tomcat.service.WebAppClassLoader.fin dClass(WebAppClassLoader.java:139)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1325)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1204)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
    at org.eclipse.emf.ecore.xml.type.util.XMLTypeUtil.is Space(XMLTypeUtil.java:50)
    at org.eclipse.emf.ecore.xml.type.util.XMLTypeUtil.no rmalize(XMLTypeUtil.java:106)
    at org.eclipse.emf.ecore.impl.EFactoryImpl.collapseWh iteSpace(EFactoryImpl.java:548)
    at org.eclipse.emf.ecore.xml.type.impl.XMLTypeFactory Impl.createDoubleObject(XMLTypeFactoryImpl.java:32 7)
    at org.eclipse.emf.ecore.xml.type.impl.XMLTypeFactory Impl.createDoubleFromString(XMLTypeFactoryImpl.jav a:2242)
    at org.eclipse.emf.ecore.xml.type.impl.XMLTypeFactory Impl.createFromString(XMLTypeFactoryImpl.java:1612 )
    at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.creat eFromString(XMLHelperImpl.java:1486)
    at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setVa lue(XMLHelperImpl.java:1050)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatu reValue(XMLHandler.java:2413)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatu reValue(XMLHandler.java:2403)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.endEleme nt(XMLHandler.java:1344)
    at org.apache.xerces.parsers.AbstractSAXParser.endEle ment(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanEndElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser .parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:3 75)
    at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XM LLoadImpl.java:180)
    at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doL oad(XMLResourceImpl.java:179)

  2. #2
    Join Date
    Mar 2008
    Posts
    1

    Default

    It could be that you're loading too many classes? or reloading your context often with a lot of library jars on it?

    You can also try to change this paramter...
    maxpermsize 128M

  3. #3
    Join Date
    Feb 2008
    Location
    Dublin - Ireland
    Posts
    102

    Default

    It seems the problem is not with SI, so I'm sorry to posted it here.. It happens to be on a BIRT Engine I'm using on a receiving endpoint of SI.

    Cheers.

  4. #4
    Join Date
    Nov 2006
    Posts
    4

    Default PermSize issues

    This usually happens when using libraries like Spring and Hibernate that make heavy use of reflection. At least that's what I understand. I ran into this problem on a project about 3 years ago when folks on that team were trying to get very fancy with a custom scheduler (based on Quartz) that needed custom classloading.

    I suggest you beef up the MaxPermSize (I believe that the default for Sun's JVM is 64M) to 256M e.g. java --XX:MaxPermSize=256m. Good luck in getting your project running.

  5. #5
    Join Date
    May 2007
    Location
    Netherlands
    Posts
    614

    Default

    Quote Originally Posted by vkarai View Post
    This usually happens when using libraries like Spring and Hibernate that make heavy use of reflection. At least that's what I understand. I ran into this problem on a project about 3 years ago when folks on that team were trying to get very fancy with a custom scheduler (based on Quartz) that needed custom classloading.

    I suggest you beef up the MaxPermSize (I believe that the default for Sun's JVM is 64M) to 256M e.g. java --XX:MaxPermSize=256m. Good luck in getting your project running.
    The PermGen space is reserved exclusively for classloading. The problem with it is that there is no garbage collection on it. Reflection in itself is not a problem; as long as you're not creating new classes on the fly there are no problems.

    With instrumentation like cglib that is used by Spring and Hibernate to create classes at runtime, you usually need more space. Still there is no problem as long as there is a finite number of classes that can be created (all your entities when using Jpa for example). In that case you can just increase the permgen space until everything fits.

    The real problem occurs when for some reason the application is creating new classes over and over. In that case the only solution is to use a jvm without a permgen heap (or find another strategy that reuses classes).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •