Domanda

Utilizzo: HornetQ 2.0.0.CR2 configurazioni di default per la non-cluster server autonomo /.

Quando provo per l'avvio del server con un grande giornale (> 1 GB), ho ricevuto un'un'eccezione 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)

Questo potrebbe accadere nella vita reale, quando un consumatore si ferma elaborazione dei messaggi e ho bisogno di riavviare il server.

Non c'è alcuna soluzione per questo? O quali configurazioni dovrei tentare di modificare?

È stato utile?

Soluzione

Si scopre che era semplice per evitare completamente questo problema.

Il paging non è abilitato nella configurazione di default!

L'aggiunta di queste 2 righe sul hornetq-configuration.xml dovrebbe fare il trucco:

   <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>

Ora è possibile avere enormi code in attesa di essere processato.

Altri suggerimenti

qui Sembra che il tuo mucchio è troppo piccolo.

  

Il collettore parallelo genera un   OutOfMemoryError se troppo tempo è   essendo trascorso in garbage collection: se   più del 98% del tempo totale è   trascorso in garbage collection e meno   del 2% della memoria viene recuperato, un   OutOfMemoryError sarà gettato. Questo   funzione è progettata per prevenire   applicazioni da corsa per un   periodo di tempo prolungato mentre fa   poco o nessun progresso perché il mucchio   è troppo piccolo. Se necessario, tale   funzione può essere disabilitata con l'aggiunta del   opzione -XX: -UseGCOverheadLimit al   riga di comando.

Hai provato modificando le opzioni di memoria JVM, e -Xmx (allocatable memoria massima) in particolare? Ho il sospetto che è necessario aumentare la memoria max JVM, per dare headroom sufficiente per elaborare i messaggi.

Se è acceso si può semplicemente eliminare la coda di uno sviluppatore cancellando la directory di lavoro HornetQ (ad esempio ~ / lavoro / hornetq).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top