JTable has memory leak

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: P3
    • None
    • Affects Version/s: 1.1.5
    • Component/s: client-libs



      Name: el35337 Date: 06/10/98


      There is a memory leak in the swing-component JTable.
      JTable adds itself to a TableModel in the method

       public void setModel(TableModel newModel)

      But it never removes itself from that model until setModel is
      called again. Remember - the TableModel could itself be
      referenced from other objects. After JTable is being removed
      from its parent component, such a back-reference stops the
      gc to collect it !!!!

      So JTable has to de-register itself from its model in case it
      is not shown anymore. I suggest it overrides

       public void removeNotify()

      and calls removeTableModelListener() from there. That way
      it is insured that all references to the JTable-object are
      cleared - garbage collection can occur then.
      (Review ID: 32627)
      ======================================================================

            Assignee:
            Philip Milne (Inactive)
            Reporter:
            Erik Larsen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: