You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Justin Bertram (Jira)" <ji...@apache.org> on 2024/10/08 14:26:00 UTC

[jira] [Commented] (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=17887610#comment-17887610 ] 

Justin Bertram commented on ARTEMIS-5089:
-----------------------------------------

Is there any evidence that any Artemis code is holding references to these objects? If not, I'm not sure there's anything which can be done in Artemis code to ensure these objects get cleaned up.

> 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