5

我有一个Wildfly ASJMS 设置,我正在使用 Jconsole 监控它,并注意到在我什至在我的会话上创建会话ConsumerProducer线程数稳步增加之前,我以前使用Wildfly 9 final出于相同目的使用它,即使在使用,但它有一个内存泄漏,促使我升级。

Jconsole我可以看到:

Thread-2(ActiveMQ-client-global-threads-3258368)
Thread-4(ActiveMQ-client-global-threads-3258368)
Thread-5(ActiveMQ-client-global-threads-3258368)
Thread-6(ActiveMQ-client-global-threads-3258368)
.
.
.
Thread-16(ActiveMQ-client-global-threads-3258368)

我该如何解决这个问题?是否有我可以更改的设置导致这些线程产生,是否有更多信息可以Jconsole帮助我解决这个问题?

4

2 回答 2

7

更新:我尝试了这种配置,但它对我不起作用。原因是 ActiveMq Artemis 使用了一个固定的线程池执行器,它被配置为 500 个线程。在对 Artemis 进行一些更改后,它将在 Wildfly 中解决。您可以在 Jira 中查看状态(查看最后的评论):

https://issues.jboss.org/browse/JBEAP-2947

论坛:

https://developer.jboss.org/thread/268397

解决方法:

sh standalone.sh -c standalone-full.xml -Dactivemq.artemis.client.global.thread.pool.max.size=30

原答案:

您是否尝试过设置远程连接属性?

 <connection-factory name="RemoteConnectionFactory"
 entries="java:jboss/exported/jms/RemoteConnectionFactory"
 connectors="http-connector" use-global-pools="false"
 thread-pool-max-size="10"/>
于 2016-03-07T14:32:40.270 回答
1

You can fine tuning the MDB for a specific use case just setting the properties useGlobalPools to false and threadPoolMaxSize according to the expected limit:

@MessageDriven(activationConfig = { 
    @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "queue/emailQueue"),
    @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
    @ActivationConfigProperty(propertyName = "useGlobalPools", propertyValue = "false"),
    @ActivationConfigProperty(propertyName = "threadPoolMaxSize", propertyValue = "20"),
    @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge") })

If you set the connection factory properties use-global-pools="false" and thread-pool-max-size="20" in the standalone.xml or even pass as a VM argument, you will have a global behavior applied for all MDBs, it is maybe not a good idea.

于 2021-06-08T02:16:58.010 回答