Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-6242

Remove static references to ResourceDefinition instances

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • None
    • None

      Similarly to WFLY-17418

       

      ResourceDefinition instances are only used during subsystem registration. Unfortunately, many subsystems reference each ResourceDefinition instance in a static reference, which prevents their garbage collection once subsystem registration is complete.
      In most cases, these static references are only used by the PersistentResourceXMLParser implementations to obtain the PathElement of a given ResourceDefinition - even though static references to PathElement instances typically exist already.
      Eliminating these static references will reduce the metaspace overhead of the server by allowing all ResourceDefinition instances to be garbage collected after the initial subsystem registration.

      For WildFly Core there are not too many of them, a quick look reveals the following potential ones:

      $ git grep "subsystem.registerSubsystemModel(.*INSTANCE"
      controller/src/main/java/org/jboss/as/controller/services/path/ResolvePathHandler.java: *                  final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(CustomFileResource.INSTANCE);
      io/subsystem/src/main/java/org/wildfly/extension/io/IOExtension.java:        final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(IORootDefinition.INSTANCE);
      security-manager/src/main/java/org/wildfly/extension/security/manager/SecurityManagerExtension.java:        final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(SecurityManagerRootDefinition.INSTANCE);
      

       There could be more, however, if there is a reduced number of them, we can go by using this JIRA to avoid having a list of subtasks per line to modify.

              rchakrab Ranabir Chakraborty
              yborgess1@redhat.com Yeray Borges Santana
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: