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 12:45:00 UTC

[jira] [Updated] (ARTEMIS-5089) 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:all-tabpanel ]

Aleh Balakhanau updated ARTEMIS-5089:
-------------------------------------
    Summary: Netty resources remain in memory when application is undeployed from app server.  (was: DESCR TBD Netty resources remain in memory when application is undeployed from app server.)

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



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