Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-6295

Fix non-static inner classes for better memory management

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.0, 4.15.0
    • Fix Version/s: 5.1.0, 4.16.0
    • Component/s: None
    • Labels:
      None

      Description

      If an inner class does not need to reference its enclosing instance, it can be static. This prevents a common cause of memory leaks and uses less memory per instance of the class (enclosing).

      Came across StatsDeleteHandler as a non static inner class defined in MetaDataEndpointImpl without holding any implicit reference to MetaDataEndpointImpl. Taking this opportunity to  find other non-static inner classes that are not holding implicit reference to their respective enclosing instances.

        Attachments

          Activity

            People

            • Assignee:
              vjasani Viraj Jasani
              Reporter:
              vjasani Viraj Jasani
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: