Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-25771

(7.4.z) WFCORE-6533 Memory leak in ElytronDefinition / DelegatingAuthConfigFactory

XMLWordPrintable

    • False
    • None
    • False
    • -
    • Hide
      • Run EAP in standalone mode,
      • run :reload operations repeatedly,
      • in a profiling tool check that new instances of ElytronAuthConfigFactory and DelegatingAuthConfigFactory are being created and are not garbage collected.

      See JBEAP-25589 for more detailed reproducer.

      Show
      Run EAP in standalone mode, run :reload operations repeatedly, in a profiling tool check that new instances of ElytronAuthConfigFactory and DelegatingAuthConfigFactory are being created and are not garbage collected. See JBEAP-25589 for more detailed reproducer.

      This issue is only present in wildfly-core 15.0.x branch. It is a component of JBEAP-25589.

      During app server reload, the Elytron integration layer registers new AuthConfigFactory:

      ElytronDefinition$ElytronAdd#performBoottime():

                      final AuthConfigFactory authConfigFactory = doPrivileged((PrivilegedAction<AuthConfigFactory>) ElytronDefinition::getAuthConfigFactory);
                      if (authConfigFactory != null) {
                          // TODO This wrapping is only temporary to allow us to delegate to the PicketBox impl, at a later point there really should only
                          //  be one AuthConfigFactory at a time.
                          registerAuthConfigFactory(new DelegatingAuthConfigFactory(new ElytronAuthConfigFactory(), authConfigFactory, ALLOW_DELEGATION));
                      } else {
                          ...
                      }
      

      The factory registered is the DelegatingAuthConfigFactory chained with the original AuthConfigFactory instance. The original factory instance is obtained just before the register call. In effect, during the reload operation the chain of DelegatingAuthConfigFactory instances becomes deeper and deeper, as the previously created instances are used as delegates of the new instance.

            thofman Tomas Hofman
            thofman Tomas Hofman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: