cancel
Showing results for 
Search instead for 
Did you mean: 

3.4b centOS - OutOfMemoryError: Java heap space

stevegreenbaum
Champ in-the-making
Champ in-the-making
I installed 3.4b on centOS 5.3, but receive a 404 error when trying to connect to /alfresco.  After I start Alfresco, if I connect to /share I receive the log in screen, but can't successfully log in.  No errors were received during the installation process.  When I connect to http://ipaddress:8080, I receive the default tomcat screen.  I receive a Java heap space error in alfresco.log.  The server has 1.5g and Alfresco DM is the only thing running on it. 

I set java_opts in setenv.sh to JAVA_OPTS="$JAVA_OPTS -Xms1028m -Xmx1028m -XX:MaxPermSize=128m -server "

Here is what is running via ps command:

root     15463     1 79 17:31 pts/1    00:01:52 /opt/alfresco-3.4.b/java/bin/java
-Djava.util.logging.config.file=/opt/alfresco-3.4.b/tomcat/conf/logging.properties
-XX:MaxPermSize=128m -Xms1028m -Xmx1028m
-Dalfresco.home=/opt/alfresco-3.4.b -Dcom.sun.management.jmxremote
-Xms1280m -Xmx1280m -XX:MaxPermSize=128m -server
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/alfresco-3.4.b/tomcat/endorsed -classpath /opt/alfresco-3.4.b/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/alfresco-3.4.b/tomcat -Dcatalina.home=/opt/alfresco-3.4.b/tomcat -Djava.io.tmpdir=/opt/alfresco-3.4.b/tomcat/temp org.apache.catalina.startup.Bootstrap

Why are there two sets of memory parameters above?  Doesn't setenv override any defaults?  Any suggestions on how to resolve this?  I looked at the jvm wiki page and didn't see anything else to try. 



01:55:23,535 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.jaxws.EndpointImpl–519378085': Invocation of init me$
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
        at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
Caused by: java.lang.OutOfMemoryError: Java heap space
        at java.util.HashMap.<init>(HashMap.java:209)
        at org.apache.ws.commons.schema.XmlSchemaObjectTable.<init>(XmlSchemaObjectTable.java:42)
        at org.apache.ws.commons.schema.XmlSchema.<init>(XmlSchema.java:111)
        at org.apache.ws.commons.schema.XmlSchema.<init>(XmlSchema.java:92)
        at org.apache.ws.commons.schema.SchemaBuilder.<init>(SchemaBuilder.java:97)
        at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:508)
        at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:493)
        at org.apache.cxf.common.xmlschema.SchemaCollection.read(SchemaCollection.java:168)


3 REPLIES 3

dranakan
Champ on-the-rise
Champ on-the-rise
Hello,

The memory parameters are defined in : /opt/Alfresco/tomcat/scripts/ctl.sh

You can remove the "-XX:MaxPermSize=512m -Xms256m -Xmx512m"…

(in 3.4a)

gyro_gearless
Champ in-the-making
Champ in-the-making
I guess your -Xms (the java stack size, IIRR) is way to large, usually 128 mB is sufficient - here is a typical setting from one of our linux boxes:

JAVA_OPTS='-Xms128m -Xmx1536m -XX:MaxPermSize=256m -server'

but this is for a machine with a bit more RAM, so i'd try something from 768m to 1024m for -Xmx 🙂

HTH
Gyro

stevegreenbaum
Champ in-the-making
Champ in-the-making
Thanks for your replies. 

I've still not been able to start Alfresco even with all of these suggestions.  I've stopped using /alfresco/tomcat/bin/setenv.sh to set my JAVA_OPTS which was causing the parameters to appear twice when it was starting Tomcat.  I'm now making all of my changes to the ctl.sh.

I've tried Xmx sizes that vary from 512m to 1280 and various sizes of Xms.  There is no combination that works.  When I look at the log I only see the java heap error when the server is started.  I can see also that the other .war files get loaded without error including Share.  As I mentioned, I can reach /Share and the login screen is presented, but I can't log in. 

The installation has JAVA_HOME set to /opt/jdk1.6.0_21 since numerous posts indicate that Alfresco will only run on CentOS using the Sun java installation. 

I am running on centOS v5.3 Final.

This machine has a v3.3 environment installed on it as well and that environment works fine.  I initially used the same JAVA_OPTS from that instance, but those didn't work either.

Any other suggestions would be appreciated.

Here is the latest alfresco.log
21:39:44,255 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from class path resource [alfresco/repository.properties]
21:39:44,257 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from class path resource [alfresco/domain/transaction.properties]
21:39:44,257 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from file [/opt/alfresco-3.4.b/tomcat/webapps/alfresco/WEB-INF/cl$
21:39:44,257 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from file [/opt/alfresco-3.4.b/tomcat/webapps/alfresco/WEB-INF/cl$
21:39:44,257 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from URL [file:/opt/alfresco-3.4.b/tomcat/shared/classes/alfresco$
21:39:44,305 INFO  [org.alfresco.config.JndiPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/alfresco-shared.proper$
21:39:44,443 INFO  [org.alfresco.config.FixedPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/version.properties]
21:39:44,476 INFO  [org.alfresco.config.FixedPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/domain/cache-strategi$
21:39:44,501 INFO  [org.alfresco.config.FixedPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/module/org.alfresco.m$
21:39:44,502 INFO  [org.alfresco.config.FixedPropertyPlaceholderConfigurer] Loading properties file from URL [file:/opt/alfresco-3.4.b/tomcat/shared/classes$
21:39:58,042 INFO  [org.springframework.extensions.webscripts.TemplateProcessorRegistry] Registered template processor Repository Template Processor for ext$
21:39:58,044 INFO  [org.springframework.extensions.webscripts.ScriptProcessorRegistry] Registered script processor Repository Script Processor for extension$
21:40:42,682 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.jaxws.EndpointImpl—1647361672': Invocation of init $
21:40:42,682 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.jaxws.EndpointImpl—1647361672': Invocation of init $
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
        at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:519)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.OutOfMemoryError: Java heap space
        at java.lang.String.substring(String.java:1939)
        at java.lang.String.substring(String.java:1904)
        at org.apache.ws.commons.schema.SchemaBuilder.getRefQName(SchemaBuilder.java:596)
        at org.apache.ws.commons.schema.SchemaBuilder.getRefQName(SchemaBuilder.java:566)
        at org.apache.ws.commons.schema.SchemaBuilder.handleElement(SchemaBuilder.java:1406)
        at org.apache.ws.commons.schema.SchemaBuilder.handleSequence(SchemaBuilder.java:964)
        at org.apache.ws.commons.schema.SchemaBuilder.handleComplexType(SchemaBuilder.java:661)
        at org.apache.ws.commons.schema.SchemaBuilder.handleElement(SchemaBuilder.java:1433)
        at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:210)
        at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:121)
        at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:509)
        at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:493)
        at org.apache.cxf.common.xmlschema.SchemaCollection.read(SchemaCollection.java:168)
        at org.apache.cxf.databinding.AbstractDataBinding.addSchemaDocument(AbstractDataBinding.java:135)
        at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:323)
        at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:376)
        at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:523)
        at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:439)
        at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:195)
        at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:163)
        at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)
        at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:117)
        at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:167)
        at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:346)
        at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:259)
        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:209)
        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:404)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1529)
21:40:50,303 INFO  [org.springframework.extensions.webscripts.DeclarativeRegistry] Registered 261 Web Scripts (+0 failed), 269 URLs
21:40:50,304 INFO  [org.springframework.extensions.webscripts.DeclarativeRegistry] Registered 8 Package Description Documents (+0 failed)
21:40:50,304 INFO  [org.springframework.extensions.webscripts.DeclarativeRegistry] Registered 0 Schema Description Documents (+0 failed)
21:40:50,533 INFO  [org.springframework.extensions.webscripts.AbstractRuntimeContainer] Initialised Spring Surf Container Web Script Container (in 1681.516m$
21:40:50,942 INFO  [org.springframework.extensions.webscripts.TemplateProcessorRegistry] Registered template processor freemarker for extension ftl
21:40:51,016 INFO  [org.springframework.extensions.webscripts.ScriptProcessorRegistry] Registered script processor javascript for extension js
21:40:51,096 INFO  [org.springframework.extensions.webscripts.TemplateProcessorRegistry] Registered template processor freemarker for extension ftl