[ 
https://issues.apache.org/jira/browse/LOG4J2-2216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16336945#comment-16336945
 ] 

Ralph Goers commented on LOG4J2-2216:
-------------------------------------

I can't find any class named JMXFactoryConnector. I do see a usage of 
JMXConnectorFactory in ClientGui. While I agree it should use try with 
resources I don't see how this could lead to any thread leaks as a JMXConnector 
is only created once each time the application is run and all the threads in 
the client app will terminate when the application ends and the connection will 
be closed by Java or the OS.  The stack overflow link seems to be referring to 
thread leaks in the client so I assume you are somehow seeing them in CleintGui 
or are you seeing them in the JMX server?

> JMXFactoryConnector is not closed in ClientGui
> ----------------------------------------------
>
>                 Key: LOG4J2-2216
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2216
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: JMX
>    Affects Versions: 2.6, 2.8
>            Reporter: edgar wang
>            Priority: Minor
>
> JMXFactoryConnector is not closed in ClientGui. This potentially could cause 
> a thread leak according to 
> [https://stackoverflow.com/questions/564589/dynamic-proxies-with-jmx-can-cause-thread-leaks]
>  . Since JMXFactoryConnector implements closable and autoclosable, it should 
> be wrapped in a try with resources or the connector should be closed 
> somewhere.
> We've seen several unclosed JMX threads in our production environment and 
> believe this could be a reason why. 
> Could anyone advise?
> Thanks!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to