-
Bug
-
Resolution: Done
-
Blocker
-
37.0.0.Final, 37.0.1.Final, 38.0.0.Final, 38.0.1.Final, 39.0.0.Final
-
None
*Environment:*
WildFly 37 (migrating from WildFly 24)
JDK 21
*Description:*
During migration of a large legacy EAR application (approx. 40 modules) from WildFly 24 to WildFly 37, we observed a significant increase in retained heap memory.
Analysis of the Heap Dump using MAT revealed that `org.jboss.as.ee.component.ComponentConfiguration` instances (which should be deployment-time only) are not being garbage collected.
*Root Cause Analysis:*
The `ComponentConfiguration` is being captured by a Lambda expression inside `ViewBindingConfigurator`, which is held by `RemoteViewInjectionSource` within a `BinderService` in the MSC Service Container.
Since the `BinderService` persists for the lifecycle of the application, the `ComponentConfiguration` is effectively leaked.
*GC Root Path:*
org.jboss.msc.service.ServiceContainerImpl
└── registry
└── table (ConcurrentHashMap)
└── node -> ServiceRegistrationImpl
└── service -> ServiceControllerImpl
└── value -> BinderService
└── source -> RemoteViewInjectionSource
└── viewClassLoader -> ViewDescription$ViewBindingConfigurator$$Lambda
└── arg$1 -> ComponentConfiguration
*Suggested Fix (from Zulip discussion):*
Brian Stansberry noted that this can likely be fixed by pulling the `componentConfiguration.getModuleClassLoader()` call outside of the lambda in `ViewBindingConfigurator`.