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

Lars Uffmann edited comment on CXF-8885 at 8/11/23 9:53 AM:
------------------------------------------------------------

I just noted that - even with [~leowoerteler]  's change - in case of a jaxws 
client proxy, the Selector Manager Thread is only garbage collected If a client 
is proactively closed, using try-with-resources, or manually.
{code:java}
      if (client instanceof AutoCloseable autoCloseable) {
        autoCloseable.close();
      }{code}
I'm sure there will be code bases where a jaxws client proxy is not closed, see 
for example

 
[https://stackoverflow.com/questions/3807095/is-it-necessary-to-close-jax-ws-port]

The example I mentioned earlier has a test case demoing the effect.


was (Author: cachescrubber):
I just noted that - even with this change - in case of a jaxws client proxy, 
the Selector Manager Thread is only garbage collected If a client is 
proactively closed, using try-with-resources, or manually.
{code:java}
      if (client instanceof AutoCloseable autoCloseable) {
        autoCloseable.close();
      }{code}
I'm sure there will be code bases where a jaxws client proxy is not closed, see 
for example

 
[https://stackoverflow.com/questions/3807095/is-it-necessary-to-close-jax-ws-port]

The example I mentioned earlier has a test case demoing the effect.

> HttpClient SelectorManager threads run indefinitely causing OOM
> ---------------------------------------------------------------
>
>                 Key: CXF-8885
>                 URL: https://issues.apache.org/jira/browse/CXF-8885
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 4.0.0, 3.6.0
>            Reporter: Cardo Eggert
>            Priority: Major
>         Attachments: image (5).png
>
>
> Probably caused by https://issues.apache.org/jira/browse/CXF-8840 .
> Started to notice that when updating from 3.5.x to 3.6.0 that our servers 
> started getting OOM. Noticed from the resulting logs that a lot of threads 
> were active that were in the format 
> HttpClient-<NR>-SelectorManager
> when reverted to 3.5.6 then it did not occur anymore.
>  
> Tried to use VirtualVM when debugging it and saw when the thread was started, 
> it never died, basically meaning that it ran indefinitely. OOM happened when 
> there were about over 1000 of these threads.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to