1

アプリケーションでメッセージ ブローカーを構成していないにもかかわらず、ヒープ スペース エラーが原因で OpenShit Prouction アプリが毎日 1 回自動的に再起動します。

activemq を明示的に無効にする必要がありますか?

[31m01:34:12,417 ERROR [org.apache.activemq.artemis.core.client] (Thread-114 (ActiveMQ-remoting-threads-ActiveMQServerImpl::serverUUID=54cb8ef9-d17a-11e5-b538-af749189a999-28800659-992791)) AMQ214017: Caught unexpected Throwable: java.lang.OutOfMemoryError: unable to create new native thread
    at java.lang.Thread.start0(Native Method)
    at java.lang.Thread.start(Thread.java:714)
    at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:950)
    at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1357)
    at org.apache.activemq.artemis.utils.OrderedExecutorFactory$OrderedExecutor.execute(OrderedExecutorFactory.java:85)
    at org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnection.write(InVMConnection.java:163)
    at org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnection.write(InVMConnection.java:151)
    at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.send(ChannelImpl.java:259)
    at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.send(ChannelImpl.java:201)
    at org.apache.activemq.artemis.core.protocol.core.ServerSessionPacketHandler.doConfirmAndResponse(ServerSessionPacketHandler.java:579)
    at org.apache.activemq.artemis.core.protocol.core.ServerSessionPacketHandler.access$000(ServerSessionPacketHandler.java:116)
    at org.apache.activemq.artemis.core.protocol.core.ServerSessionPacketHandler$1.done(ServerSessionPacketHandler.java:561)
    at org.apache.activemq.artemis.core.persistence.impl.journal.OperationContextImpl.executeOnCompletion(OperationContextImpl.java:161)
    at org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager.afterCompleteOperations(JournalStorageManager.java:666)
    at org.apache.activemq.artemis.core.protocol.core.ServerSessionPacketHandler.sendResponse(ServerSessionPacketHandler.java:546)
    at org.apache.activemq.artemis.core.protocol.core.ServerSessionPacketHandler.handlePacket(ServerSessionPacketHandler.java:531)
    at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.handlePacket(ChannelImpl.java:567)
    at org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.doBufferReceived(RemotingConnectionImpl.java:349)
    at org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:331)
    at org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:605)
    at org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnection$1.run(InVMConnection.java:171)
    at org.apache.activemq.artemis.utils.OrderedExecutorFactory$OrderedExecutor$ExecutorTask.run(OrderedExecutorFactory.java:100)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
4

4 に答える 4

1

Wildfly openshift カートリッジ プロジェクトの未解決の問題に関するこのコメントをご覧ください。

要約すると、一部のユーザーは、このカートリッジのデフォルト設定でメモリ、パフォーマンスの問題を経験しています。これは特に、Openshift Wildfly カートリッジがデフォルトで Java EE 7 フル プロファイルを有効にする (デフォルトの wildfly スタンドアロン構成のように standalone-full.xml ではなく、カスタムの standalone.xml 構成ファイルを使用する) ためです。制限があるためギアが小さい。

しかし、多くの Java EE 7 ユーザーは Web プロファイルのみを使用しており、実際にはアプリケーションですべての Java EE 7 フル プロファイル仕様を有効にする必要はありません。

したがって、Java EE 7 Web プロファイル機能のみを有効にし、メッセージング サブシステムなどのフル プロファイル固有のものを無効にすることで、このカートリッジを小さなギアで正常に動作させることができます。

ソリューションの詳細については、この他のコメントと、Java EE 7 プロファイル間の相違点をリストしたこの表も参照してください。

于 2016-07-05T16:12:20.657 に答える
0

を追加してみてください-Dactivemq.artemis.client.global.thread.pool.max.size=20

Artemis クライアントが使用するデフォルトのグローバル スレッド プールは 500 ですが、小さなギアには 250 スレッドのスレッド制限があります。ユーザーあたり 4096 スレッドの Linux マシンで 8 つの Wildfly インスタンスを開始したときに、同様の問題が発生しました。翌日、常に java.lang.OutOfMemoryError: Cannot create new native thread が発生しました。Artemis は、500 に達するまで常に新しいスレッドを作成することがわかりました。

于 2016-03-24T14:55:02.817 に答える
0

これを小さなギアで実行している場合、それが問題です。WildFly 10 は、それだけでかなりの量のメモリを使用します。中型または大型のギアで実行する必要があります。JVM で使用できるギアのメモリ量を変更することもできます: https://developers.openshift.com/en/wildfly-jvm-memory.html

于 2016-02-17T15:47:03.277 に答える