activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noevil Wang <wxl24l...@gmail.com>
Subject java.lang.OutOfMemoryError: Java heap space
Date Mon, 20 Aug 2012 05:24:52 GMT
hi, all~

i met "java.lang.OutOfMemoryError: Java heap space" error while
starting an activemq broker.  I am using: apache-activemq-5.6.0-win

The broker was configured for persistent storage using oracle
database. The broker could start normally, then i mannally created an
queue and input some persistent messages into the queue on the
localhost activemq console. As was expected, three tables,
ACTIVEMQ_ACKS, ACTIVEMQ_LOCK, and ACTIVEMQ_MSGS, were created. The
messages were stored in  ACTIVEMQ_MSGS, and after stopped the broker,
those messges were persistent in the table.


Up to now, all the processes worked OK. However, after i restarted the
broker, "java.lang.OutOfMemoryError: Java heap space" error occured.

Another obervation, if the ACTIVEMQ_MSGS was dropped or all messages
in ACTIVEMQ_MSGS were deleted, the broker can once again started
normally.


------activemq.xml

<persistenceAdapter>
        <jdbcPersistenceAdapter dataDirectory="activemq-data"
dataSource="#oracle-ds" />
</persistenceAdapter>

<systemUsage>
        <systemUsage>
                   <memoryUsage>
                           <memoryUsage limit="64 mb" />
                   </memoryUsage>
                   <storeUsage>
                          <storeUsage limit="100 gb" />
                   </storeUsage>
                   <tempUsage>
                          <tempUsage limit="10 gb" />
                   </tempUsage>
         </systemUsage>
</systemUsage>

<!-- Oracle DataSource Sample Setup -->
  <bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
    <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
<property name="url"
value="jdbc:oracle:thin:@(description=(address=(host=myurl)(protocol=tcp)(port=1521))(connect_data=(service_name=myservicename)))"
/>
    <property name="username" value=" myservicename "/>
    <property name="password" value=" myservicepassword"/>
    <property name="poolPreparedStatements" value="true"/>
  </bean>

------ErrorInfo from activemq.log


2012-08-20 13:24:32,072 | INFO  | Refreshing
org.apache.activemq.xbean.XBeanBrokerFactory$1@4104c575: startup date
[Mon Aug 20 13:24:32 CST 2012]; root of context hierarchy |
org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
2012-08-20 13:24:32,914 | INFO  |
PListStore:[d:\works\oracle-backup\apache-activemq-5.6.0-win-01\bin\activemq-data\Host01\tmp_storage
] started | org.apache.activemq.store.kahadb.plist.PListStore | main
2012-08-20 13:24:32,943 | INFO  | Using Persistence Adapter:
JDBCPersistenceAdapter(org.apache.commons.dbcp.BasicDataSource@739abd2b)
| org.apache.activemq.broker.BrokerService | main
2012-08-20 13:24:33,426 | INFO  | Database adapter driver override
recognized for : [oracle_jdbc_driver] - adapter: class
org.apache.activemq.store.jdbc.adapter.OracleJDBCAdapter |
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter | main
2012-08-20 13:24:33,664 | INFO  | Database lock driver override not
found for : [oracle_jdbc_driver].  Will use default implementation. |
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter | main
2012-08-20 13:24:33,668 | INFO  | Attempting to acquire the exclusive
lock to become the Master broker |
org.apache.activemq.store.jdbc.DefaultDatabaseLocker | main
2012-08-20 13:24:33,695 | INFO  | Becoming the master on dataSource:
org.apache.commons.dbcp.BasicDataSource@739abd2b |
org.apache.activemq.store.jdbc.DefaultDatabaseLocker | main
2012-08-20 13:24:33,710 | INFO  | ActiveMQ 5.6.0 JMS Message Broker
(Host01) is starting | org.apache.activemq.broker.BrokerService | main
2012-08-20 13:24:33,712 | INFO  | For help or more information please
see: http://activemq.apache.org/ |
org.apache.activemq.broker.BrokerService | main
2012-08-20 13:24:34,212 | ERROR | Failed to load: class path resource
[activemq.xml], reason: Error creating bean with name
'org.apache.activemq.xbean.XBeanBrokerService#0' defined in class path
resource [activemq.xml]: Invocation of init method failed; nested
exception is java.lang.OutOfMemoryError: Java heap space |
org.apache.activemq.xbean.XBeanBrokerFactory | main
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
'org.apache.activemq.xbean.XBeanBrokerService#0' defined in class path
resource [activemq.xml]: Invocation of init method failed; nested
exception is java.lang.OutOfMemoryError: Java heap space
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
	at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:108)
	at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:108)
	at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:72)
	at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
	at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
	at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:115)
	at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:74)
	at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
	at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:148)
	at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
	at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:90)
	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.activemq.console.Main.runTaskClass(Main.java:257)
	at org.apache.activemq.console.Main.main(Main.java:111)
Caused by: java.lang.OutOfMemoryError: Java heap space
	at org.apache.activemq.openwire.v6.BaseDataStreamMarshaller.looseUnmarshalByteSequence(BaseDataStreamMarshaller.java:639)
	at org.apache.activemq.openwire.v6.WireFormatInfoMarshaller.looseUnmarshal(WireFormatInfoMarshaller.java:132)
	at org.apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireFormat.java:373)
	at org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:210)
	at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:254)
	at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:145)
	at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:109)
	at org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:108)
	at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1996)
	at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1990)
	at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1947)
	at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:802)
	at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.start(JDBCPersistenceAdapter.java:314)
	at org.apache.activemq.broker.BrokerService.start(BrokerService.java:525)
	at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:60)
	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:1544)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1485)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)

Mime
View raw message