Page 1 of 1
Getting PermGen Space error when deploying tomcat 7
Posted: Tue Aug 06, 2013 5:20 am
by makpandian
I have deployed BL site application on Tomcat 7. But often I have been getting PermGen space error. I did some configuration changes on catalina.bat but no luck.
Seems there s a big memory leak on it. How to avoid it.?
Thanks
Pandian
Re: Getting PermGen Space error when deploying tomcat 7
Posted: Tue Aug 06, 2013 8:52 am
by phillipuniverse
You can increase Permgen with something like -XX:MaxPermSize=512m. You would set this in CATALINA_OPTS for Tomcat.
Re: Getting PermGen Space error when deploying tomcat 7
Posted: Tue Mar 17, 2015 3:24 pm
by kkoyman
I have the same problem.
Does anyone have solution for this?
Code: Select all
INFO: Initializing Spring root WebApplicationContext
[ WARN] 16:38:42 RuntimeEnvironmentPropertiesConfigurer - Unable to determine runtime environment, using default environment 'development'
[ WARN] 16:38:45 MergePersistenceUnitManager - A BroadleafClassTransformer is configured for this persistence unit, but Spring reported a problem (likely that a LoadTimeWeaver is not registered). As a result, the Broadleaf Commerce ClassTransformer (org.broadleafcommerce.common.extensibility.jpa.copy.DirectCopyClassTransformer) is not being registered with the persistence unit.
[ WARN] 16:38:45 MergePersistenceUnitManager - A BroadleafClassTransformer is configured for this persistence unit, but Spring reported a problem (likely that a LoadTimeWeaver is not registered). As a result, the Broadleaf Commerce ClassTransformer (org.broadleafcommerce.common.extensibility.jpa.convert.EntityMarkerClassTransformer) is not being registered with the persistence unit.
[ WARN] 16:38:45 MergePersistenceUnitManager - A BroadleafClassTransformer is configured for this persistence unit, but Spring reported a problem (likely that a LoadTimeWeaver is not registered). As a result, the Broadleaf Commerce ClassTransformer (org.broadleafcommerce.common.extensibility.jpa.copy.DirectCopyClassTransformer) is not being registered with the persistence unit.
[ WARN] 16:38:49 AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [blSandBoxElements]; using defaults.
Mar 14, 2015 4:39:01 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'mycompany'
[ WARN] 16:39:01 RuntimeEnvironmentPropertiesConfigurer - Unable to determine runtime environment, using default environment 'development'
Mar 14, 2015 4:39:03 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(F:\17_Recent\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\admin\WEB-INF\lib\jsp-api-2.1.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/el/Expression.class
Mar 14, 2015 4:39:10 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Mar 14, 2015 4:39:10 PM org.apache.catalina.core.ApplicationContext log
INFO: Set web app root system property: 'blAdmin.root' = [F:\17_Recent\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\admin\]
Mar 14, 2015 4:39:10 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing log4j from [F:\17_Recent\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\admin\WEB-INF\log4j.xml]
Mar 14, 2015 4:39:10 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Mar 14, 2015 4:39:20 PM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:816)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.OutOfMemoryError: PermGen space
at org.apache.log4j.Category.forcedLog(Category.java:388)
at org.apache.log4j.Category.log(Category.java:853)
at org.slf4j.impl.Log4jLoggerAdapter.log(Log4jLoggerAdapter.java:602)
at org.apache.commons.logging.impl.SLF4JLocationAwareLog.error(SLF4JLocationAwareLog.java:225)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:336)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.broadleafcommerce.common.web.extensibility.MergeContextLoaderListener.contextInitialized(MergeContextLoaderListener.java:50)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524)
... 8 more
Mar 14, 2015 4:39:20 PM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:739)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: java.lang.OutOfMemoryError: PermGen space
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:816)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Exception in thread "main" java.lang.OutOfMemoryError: PermGen space
Exception in thread "PoolCleaner[838994469:1426343909457]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "PoolCleaner[736718356:1426343950113]" java.lang.OutOfMemoryError: PermGen space
Re: Getting PermGen Space error when deploying tomcat 7
Posted: Tue Mar 17, 2015 3:30 pm
by kkoyman
phillipuniverse wrote:You can increase Permgen with something like -XX:MaxPermSize=512m. You would set this in CATALINA_OPTS for Tomcat.
How could this be done?
On windows, I created setenv.bat in Tomcat/bin directory and input the following:
Code: Select all
set CATALINA_OPTS=-XX:PermSize=128m -XX:MaxPermSize=512M -Xms256M -Xmx768m
Nothing changed.
Re: Getting PermGen Space error when deploying tomcat 7
Posted: Mon Mar 30, 2015 3:59 pm
by kkoyman
Anyone has any solution for this?
Re: Getting PermGen Space error when deploying tomcat 7
Posted: Mon Mar 30, 2015 11:58 pm
by phillipuniverse
Your CATALINA_OPTS is wrong. You should remove -XX:PermSize=128m and you should lower-case the M in -XX:MaxPermSize such that it reads
-XX:MaxPermSize=512m
instead of:
-XX:MaxPermSize=512M
that you pasted there.
Re: Getting PermGen Space error when deploying tomcat 7
Posted: Fri Apr 03, 2015 2:30 pm
by kkoyman
phillipuniverse wrote:Your CATALINA_OPTS is wrong. You should remove -XX:PermSize=128m and you should lower-case the M in -XX:MaxPermSize such that it reads
-XX:MaxPermSize=512m
instead of:
-XX:MaxPermSize=512M
that you pasted there.
Hi,
Thanks alot for your reply.
I did the changes suggested.
The console output is as given below:
Code: Select all
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'blSiteMapService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'blModuleConfigurationService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'blModuleConfigurationDao': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.nektar.sample.vendor.nullPaymentGateway.service.payment.NullPaymentGatewayType] for bean with name 'com.nektar.sample.vendor.nullPaymentGateway.service.payment.NullPaymentGatewayType#0' defined in resource loaded from byte array; nested exception is java.lang.ClassNotFoundException: com.nektar.sample.vendor.nullPaymentGateway.service.payment.NullPaymentGatewayType
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:307)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1148)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:636)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:934)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.broadleafcommerce.common.web.extensibility.MergeContextLoaderListener.contextInitialized(MergeContextLoaderListener.java:50)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name
...
Exception in thread "main" java.lang.OutOfMemoryError: PermGen space
Exception in thread "PoolCleaner[671613224:1428089167698]" java.lang.OutOfMemoryError: PermGen space
Re: Getting PermGen Space error when deploying tomcat 7
Posted: Tue Apr 21, 2015 2:59 pm
by kkoyman
I did add this:
Double clicked the Tomcat server.. I did chose "open launch configuration".
then I added the following argument at the end of arguments tab:
-XX:MaxPermSize=512m
After maven clean and Maven install, the application runs without errors.
Thanks.☺