-
Enhancement
-
Resolution: Done
-
Major
-
None
-
None
OperationContext implements ExpressionResolver, and it's the only ExpressionResolver impl available to subsystems that's able to resolve extension expressions (like Elytron credential reference expressions). This means there's always of risk of OSH's passing the OC to objects that hold onto it beyond the lifespan of the management op that created the OC.
We should try and avoid such uses, but I think they are likely to occur, so we should minimize any impact of such use. An approach to this that I have in mind is to have OCI implement AutoCloseable and use try-with-resources with it. The close() impl will null out any heavyweight state in the OCI, so if the OCI leaks the retained state will be less.
The WildFly resource-adapters subsystem currently caches an OCI in an MSC service, and this results in nearly 10MB of retained memory:
| Retained
Class Name | Heap
-----------------------------------------------------------------------------------------------------
org.jboss.msc.service.ServiceContainerImpl$ServiceThread | 3,824
container org.jboss.msc.service.ServiceContainerImpl | 161,064
registry java.util.concurrent.ConcurrentHashMap | 159,840
table java.util.concurrent.ConcurrentHashMap$Node[8192] | 159,760
[3661] java.util.concurrent.ConcurrentHashMap$Node | 32
val org.jboss.msc.service.ServiceRegistrationImpl | 184
instance org.jboss.msc.service.ServiceControllerImpl | 1,064
service org.j.a.connector.subsystems.resadpts.ConnectionDefinitionService | 144
connectionDefinitionSupplier org.jboss.msc.value.InjectedValue | 64
value org.jboss.msc.value.RetainingInjector$$Lambda$141 | 48
arg$1 org.j.a.connector.subsystems.resadpts.ConnectionDefinitionAdd$$Lambda$720 | 32
arg$1 org.jboss.as.controller.ParallelBootOperationContext | 9,816,480
primaryContext org.jboss.as.controller.OperationContextImpl | 9,801,808
-----------------------------------------------------------------------------------------------------
- causes
-
JBEAP-24974 NPE Cannot invoke "org.jboss.as.controller.ModelControllerImpl$ManagementModelImpl.getRootResource()" because "this.managementModel" is null
-
- Closed
-
-
WFCORE-6395 NPE Cannot invoke "org.jboss.as.controller.ModelControllerImpl$ManagementModelImpl.getRootResource()" because "this.managementModel" is null
-
- Open
-