Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-13130

Slow performance and memory leak in UI Extension Points when creating a subwiki

    XMLWordPrintable

Details

    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      During wiki creation, for each XAR extension that is installed, a XARImportedEvent is sent and the DefaultWikiComponentManagerEventListener receives it and re-registers all UIExtension components found in the wiki.

      For example when installing the org.xwiki.enterprise:xwiki-enterprise-ui-wiki-8.0-SNAPSHOT XAR in a new wiki, this extension depends on 45 other extensions. And since there are 30 panels declared as UIExtension, this means registering 45*30 = 1350 UIX component. So this is slower than it should be.

      In addition the code in DefaultWikiComponentManager.registerWikiComponent() does the following (see https://github.com/xwiki/xwiki-platform/blob/fb35fbb0d2efe2d751adfe07cca840246dece2df/xwiki-platform-core/xwiki-platform-component/xwiki-platform-component-wiki/src/main/java/org/xwiki/component/wiki/internal/DefaultWikiComponentManager.java#L110-L110):

      // And hold a reference to it.
      this.registeredComponents.put(component, Boolean.FALSE);
      

      So if you re-register the same UIX component this map keeps growing forever. This means that every time a new wiki is created the memory available decreases causing the memory leak.

      Attachments

        Activity

          People

            vmassol Vincent Massol
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: