Skip to content

WFLY-21390 Fix memory leak of ComponentConfiguration after deployment being retained due to lambdas#19551

Merged
bstansberry merged 1 commit intowildfly:mainfrom
rhusar:WFLY-21390
Jan 27, 2026
Merged

WFLY-21390 Fix memory leak of ComponentConfiguration after deployment being retained due to lambdas#19551
bstansberry merged 1 commit intowildfly:mainfrom
rhusar:WFLY-21390

Conversation

@rhusar
Copy link
Member

@rhusar rhusar commented Jan 26, 2026

ComponentConfiguration objects were being retained after deployment due to lambda expressions capturing entire configuration objects when they only needed specific values.
Since these lambdas were stored in long-lived MSC services (e.g., BinderService), the deployment-time configuration remained in memory indefinitely.

Fix lambda captures in ViewDescription and EjbJndiBindingsDeploymentUnitProcessor
Refactor StatefulSessionBeanCacheProvider SPI to avoid retaining configuration.

Resolves
https://issues.redhat.com/browse/WFLY-21390

@wildfly-bot wildfly-bot bot requested a review from bstansberry January 26, 2026 21:09
jamezp
jamezp previously approved these changes Jan 26, 2026
bstansberry
bstansberry previously approved these changes Jan 26, 2026
…nt being retained due to lambdas

ComponentConfiguration objects were being retained after deployment due to lambda expressions capturing entire configuration objects when they only needed specific values.
Since these lambdas were stored in long-lived MSC services (e.g., BinderService), the deployment-time configuration remained in memory indefinitely.

Fix lambda captures in ViewDescription and EjbJndiBindingsDeploymentUnitProcessor
Refactor StatefulSessionBeanCacheProvider SPI to avoid retaining configuration.

Signed-off-by: Radoslav Husar <radosoft@gmail.com>
@wildfly-bot wildfly-bot bot requested a review from tadamski January 27, 2026 14:11
@rhusar rhusar requested review from bstansberry and jamezp January 27, 2026 14:11
@rhusar rhusar dismissed stale reviews from bstansberry and jamezp January 27, 2026 14:11

Discovered more issues and significantly refactored; needs re-review.

@rhusar rhusar changed the title WFLY-21390 Extract the class loader before the lambda to avoid captur… Fix memory leak of ComponentConfiguration after deployment being retained due to lambdas Jan 27, 2026
@rhusar rhusar changed the title Fix memory leak of ComponentConfiguration after deployment being retained due to lambdas WFLY-21390 Fix memory leak of ComponentConfiguration after deployment being retained due to lambdas Jan 27, 2026
@bstansberry bstansberry merged commit 97e6b33 into wildfly:main Jan 27, 2026
13 of 14 checks passed
@bstansberry
Copy link
Contributor

Thanks @rhusar and @jamezp

I'm going to leave the WFLY unresolved for now as it's configured to block 39.0.1 (which I agree with) and that part is still to come.

@rhusar
Copy link
Member Author

rhusar commented Jan 27, 2026

Thats correct. I will handle the rest in the morning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants