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

Fix non-static inner classes for better memory management

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.0.0, 4.15.0
    • 5.1.0, 4.16.0
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: