[
https://issues.apache.org/jira/browse/TOMEE-4214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17720871#comment-17720871
]
Stephan Freund commented on TOMEE-4214:
---------------------------------------
fork updated: HashMap in MovieService commented out, OOME still occurs
> possible memory leak using rest-client-builder
> ----------------------------------------------
>
> Key: TOMEE-4214
> URL: https://issues.apache.org/jira/browse/TOMEE-4214
> Project: TomEE
> Issue Type: Bug
> Affects Versions: 9.0.0
> Reporter: Stephan Freund
> Priority: Major
>
> An instance of Jsonb is created and registered in JohnzonCdiExtension#track
> per outgoing request.
> Test case below (with extra dummy echo rest server listening on
> [http://localhost:8080/echo)|http://localhost:8080/echo].
> App exits after a while with OutOfMemoryError.
> [https://github.com/apache/tomee/compare/main...farnetto:tomee:jaxrs-client-memory-leak]
> Problem seems to stem from use of WebTarget#path (target URI is dynamic)
> where ClientProviderFactory / JsonbJaxrsProvider is incorrectly *not* reused
> as per javadoc:
> [https://jakarta.ee/specifications/platform/9.1/apidocs/jakarta/ws/rs/client/webtarget#path-java.lang.String-]
> "A snapshot of the present configuration of the current (parent) target
> instance is taken and is inherited by the newly constructed (child) target
> instance."
--
This message was sent by Atlassian Jira
(v8.20.10#820010)