[
https://issues.apache.org/jira/browse/CXF-8885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17778618#comment-17778618
]
Lars Ködderitzsch commented on CXF-8885:
----------------------------------------
We also just stumbled over this issue.
Traditionally we never closed cxf clients as this was never documented in the
docs ([https://cxf.apache.org/docs/jax-rs-client-api.html])
For the time being we had to revert to cxf-3.5.x
However, given the discussion here, we are unsure about the intentions of the
framework going forward.
Up until cxf-3.6.x we understood that cxf clients are supposed to be
cheap/throwaway instances which can be created/discarded without specific
requirements for resource usage
For instance this comment on thread safety:
> One way to 'make' clients thread-safe is to use WebClient.fromClient(Client)
> for web clients or JAXRSClientFactoryBean.fromClient() factory methods which
> copy all the original configuration properties and can be used to create new
> client instances per every request.
[https://cxf.apache.org/docs/jax-rs-client-api.html]
Can you please clarify what the intended usage pattern and "weight" for clients
is supposed to be starting with cxf-3.6 going forward?
A substantial amount of our internal code hinges on the notion of lightweight
clients, so it would require some effort to restructure.
> 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
> Assignee: Daniel Kulp
> Priority: Major
> Fix For: 3.6.2, 4.0.3
>
> 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)