Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-99399

Mitigate memory leaks in React portlets due to interaction with Senna

    Details

      Description

      As reported by Bruno Farache here: https://github.com/brianchandotcom/liferay-portal/pull/76649#issuecomment-518729800

      there is a nasty memory leak happening on all react portlets because of senna. it happens on segments, workflow metrics and app builder, we need to unmount the root component when portlet is destroyed, like in this PR.

      here's how you reproduce it:

      https://recordit.co/Sgk0qFoI7x

      could we make a generic solution would prevent this to happen?

      So the purpose of this ticket is to investigate and figure out whether:

      • Changes can be made to Senna to prevent this from happening; or, if that is not feasible
      • Implement some kind of linting that enforces theĀ pattern showed by Bruno in that PR; (that could be checking that any call to `React.render` is accompanied by a corresponding call to `unmountComponentAtNode`; or it could be wrapping that pattern up in an API and then linting against the use of naked `React.render`)

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                7.2.10 DXP FP2
                7.2.10.1 DXP SP1
                7.2.X
                Master