You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Aleh Balakhanau (Jira)" <ji...@apache.org> on 2024/10/08 16:25:00 UTC
[jira] [Comment Edited] (ARTEMIS-5089) Artemis-jakarta-client. Netty resources remain in memory when application is undeployed from app server.
[ https://issues.apache.org/jira/browse/ARTEMIS-5089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17887654#comment-17887654 ]
Aleh Balakhanau edited comment on ARTEMIS-5089 at 10/8/24 4:24 PM:
-------------------------------------------------------------------
Yes, these objects are still in the heap.
The problem is that app server has bunch of thread pools responsible for different tasks. E.g if bean is marked as @Startup, then for instance payara server will use admin-listener-threads (that are responsible for deploy/undeploy) to open these connections. And no guarantee that the same thread will do undeployment.
Or in my case i call this attached code via triggering rest endpoint. And here some other thread group is involved.
I suspected that it is a bug of payara/glassfish server, but the issue is also reproducible on Wildfly.
was (Author: JIRAUSER307293):
Yes, these objects are still in the heap.
The problem is that app server has bunch of thread pools responsible for different tasks. E.g if bean is marked as @Startup, then for instance payara server will use admin-listener-threads (that are responsible for deploy/undeploy) to open these connections. And no guarantee that the same thread will do undeployment.
Or in my case i call this attached code via triggering http request. And here some other thread group is involved.
I suspected that it is a bug of payara/glassfish server, but the issue is also reproducible on Wildfly.
> Artemis-jakarta-client. Netty resources remain in memory when application is undeployed from app server.
> --------------------------------------------------------------------------------------------------------
>
> Key: ARTEMIS-5089
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5089
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: JMS
> Affects Versions: 2.36.0, 2.37.0
> Reporter: Aleh Balakhanau
> Priority: Major
> Attachments: image-2024-10-08-16-41-41-054.png, image-2024-10-08-16-42-38-144.png
>
>
> I've noticed that there are some netty resources remained in jvm when application is undeployed from app server (tested on Glassfish 7.0.18, Payara server 6.2024.8, Wildfly 33.0.2 Final)
> I have a code example copied from activemq-artemis-examples project.
> {code:java}
> private Session session;
> private MessageProducer producer;
> private ActiveMQConnection connection;
> private ActiveMQConnectionFactory connectionFactory;
>
> public void publish() {
> String activemqBrokerUrl = "tcp://localhost:61617?useGlobalPools=false&consumerWindowSize=0";
> String activemqUsername = "admin";
> String activemqPassword = "admin";
> try {
> connectionFactory = new ActiveMQConnectionFactory(activemqBrokerUrl, activemqUsername, activemqPassword);
> connection = (ActiveMQConnection) connectionFactory.createConnection();
> connection.start();
> session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
> Queue queue = session.createQueue("jms/test");
> producer = session.createProducer(queue);
> ObjectMessage message = session.createObjectMessage();
> message.setStringProperty("Hello", "World");
> producer.send(message);
> producer.close();
> session.close();
> connection.close();
> connectionFactory.close();
> } catch (JMSException ex) {
> log.error("JMSException", ex);
> }
> } {code}
> (tried also to add FastThreadLocal.destroy() after connectionFactory.close() line)
> All mq-related threads are down. But some netty objects remained even after app is undeployed.
> !image-2024-10-08-16-41-41-054.png|width=627,height=582!
> !image-2024-10-08-16-42-38-144.png|width=617,height=463!
> When i deploy the app again they are not reused, but created new ones.
> The same problem when using listeners(MessageListener) and JmsContext
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@activemq.apache.org
For additional commands, e-mail: issues-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact