2009-12-21 5 views
3

Использование: HornetQ 2.0.0.CR2 Конфигурации по умолчанию для автономного/некластеризованного сервера.HornetQ OutOfMemory при запуске с большим журналом

При попытке запуска сервера с большим журнала (> 1Gb), я получил OutOfMemory исключение:

[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

ответ

5

Оказалось, что было просто полностью избежать этой проблемы.

Paging он не включен в конфигурации по умолчанию!

Добавление этих 2 линии на 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.

Вы пробовали модифицировать параметры виртуальной машины Java памяти и -Xmx (макс распределяемой памяти), в частности? Я подозреваю, что вам нужно увеличить свою максимальную память JVM, чтобы дать ему достаточно места для обработки ваших сообщений.

+0

На сервере я использую -Xmx2048m, и я все еще получаю это исключение. Сервер 32bit, поэтому я не могу идти дальше. –

+0

И если вы отключите проверку GCOverheadLimit? –

+0

Это не помогает, я все равно получаю «Развертывание» JMSServerManager »имеет ошибку: java.lang.OutOfMemoryError: Java heap space" –

0

Если вы используете разработчика, вы можете просто отбросить свою очередь, удалив рабочий каталог HornetQ (например, ~/work/hornetq).

Смежные вопросы