2009-12-21 49 views
3

使用:HornetQ 2.0.0.CR2 独立/非群集服务器的默认配置。HornetQ OutOfMemory启动时使用大日志

当我尝试启动一个大的期刊(> 1GB)的服务器,我得到了一个内存溢出异常:

[main] 12:59:43,505 INFO [org.hornetq.integration.bootstrap.HornetQBootstrapServer] Starting HornetQ Server 
[main] 12:59:44,526 INFO [org.hornetq.core.server.impl.HornetQServerImpl] live server is starting.. 
[main] 12:59:44,532 WARNING [org.hornetq.core.server.management.impl.ManagementServiceImpl] It has been detected that the cluster admin user and password which are used to replicate management operation from one node to the other have not been changed from the installation default. Please see the HornetQ user guide for instructions on how to do this. 
[main] 12:59:44,564 WARNING [org.hornetq.core.persistence.impl.journal.JournalStorageManager] AIO wasn't located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to enable the AIO journal 
[main] 12:59:44,565 INFO [org.hornetq.core.persistence.impl.journal.JournalStorageManager] Using NIO Journal 
Exception in thread "hornetq-expiry-reaper-thread" java.lang.OutOfMemoryError: GC overhead limit exceeded 
at java.util.concurrent.ConcurrentHashMap.values(ConcurrentHashMap.java:1011) 
at org.hornetq.core.postoffice.impl.PostOfficeImpl$Reaper.run(PostOfficeImpl.java:1083) 
at java.lang.Thread.run(Thread.java:637) 
[main] 13:00:17,135 SEVERE [org.hornetq.integration.bootstrap.HornetQBootstrapServer] Failed to start server 
java.lang.IllegalStateException: Incompletely deployed: 

DEPLOYMENTS IN ERROR: 
    Deployment "JMSServerManager" is in error due to: java.lang.OutOfMemoryError: GC overhead limit exceeded 

at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:278) 
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:174) 
at org.hornetq.integration.bootstrap.HornetQBootstrapServer.bootstrap(HornetQBootstrapServer.java:159) 
at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:83) 
at org.hornetq.integration.bootstrap.HornetQBootstrapServer.run(HornetQBootstrapServer.java:117) 
at org.hornetq.integration.bootstrap.HornetQBootstrapServer.main(HornetQBootstrapServer.java:73) 
Exception in thread "main" java.lang.IllegalStateException: Incompletely deployed: 

DEPLOYMENTS IN ERROR: 
    Deployment "JMSServerManager" is in error due to: java.lang.OutOfMemoryError: GC overhead limit exceeded 

at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:278) 
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:174) 
at org.hornetq.integration.bootstrap.HornetQBootstrapServer.bootstrap(HornetQBootstrapServer.java:159) 
at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:83) 
at org.hornetq.integration.bootstrap.HornetQBootstrapServer.run(HornetQBootstrapServer.java:117) 
at org.hornetq.integration.bootstrap.HornetQBootstrapServer.main(HornetQBootstrapServer.java:73) 

这可能发生在现实生活当消费者停止处理的消息,我需要重新启动服务器。

这有什么解决方法吗?或者我应该尝试修改哪些配置?

+2

HornetQ邮件列表(http://www.jboss.org/hornetq/community.html)目前非常活跃,因为他们正在为1.0版本做准备。如果您怀疑存在问题,现在应该报告它。 – skaffman 2009-12-21 17:42:54

回答

5

事实证明,完全避免这个问题很简单。

Paging它没有启用默认配置!

添加在hornetq-configuration.xml文件这两条线应该做的伎俩:

<address-settings> 
     <!--default for catch all--> 
     <address-setting match="#"> 
     <dead-letter-address>jms.queue.DLQ</dead-letter-address> 
     <expiry-address>jms.queue.ExpiryQueue</expiry-address> 
     <redelivery-delay>0</redelivery-delay> 
     <page-size-bytes>10485760</page-size-bytes> 
     <message-counter-history-day-limit>10</message-counter-history-day-limit> 

     <!-- Add these 2 lines --> 
     <max-size-bytes>104857600</max-size-bytes> 
     <address-full-policy>PAGE</address-full-policy> 

     </address-setting> 
    </address-settings> 

现在它可能有巨大的队列等待处理。

0

here看来你的堆太小了。

The parallel collector will throw an OutOfMemoryError if too much time is being spent in garbage collection: if more than 98% of the total time is spent in garbage collection and less than 2% of the heap is recovered, an OutOfMemoryError will be thrown. This feature is designed to prevent applications from running for an extended period of time while making little or no progress because the heap is too small. If necessary, this feature can be disabled by adding the option -XX:-UseGCOverheadLimit to the command line.

您是否尝试过修改您的JVM内存选项,特别是-Xmx(最大内存分配)?我怀疑你需要增加你的JVM最大内存,给它足够的空间来处理你的消息。

+0

在我使用的服务器上-Xmx2048m,我仍然得到这个异常。服务器是32位,所以我不能再走了。 – 2009-12-21 17:43:52

+0

如果您禁用GCOverheadLimit检查? – 2009-12-21 17:45:49

+0

它没有帮助,我仍然得到“部署”JMSServerManager“出现错误,原因是:java.lang.OutOfMemoryError:Java堆空间” – 2009-12-21 18:09:20

0

如果是在开发人员身上,您可以通过删除HornetQ工作目录(例如〜/ work/hornetq)来简单地删除您的队列。