Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4166

Abstract renderer stores rendered item index indefinitely

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.6.1
    • 8.6.0.1
    • None
    • Security Level: Jimmy
    • None
    • ZK 8.6.1 S1

      Steps to Reproduce

      http://zkfiddle.org/sample/4kan5f/2-zk-renderer-mem-leak

      Current Result

      The size of the "$RENDERED_COMPONENTS$" attribute grows forever with each render event.
      The content of the map doesn't seem to be used and only contains pairs such as

      {0=0}

      ,

      {1=1}

      etc.

      Expected Result

      Renderer shouldn't maintain an expensive object unless there is a specific need. shallow debug couldn't find a use case for the map that could be replaced by a "last index" attribute instead which would just increment a single value instead of storing every past index

      Debug Info

      AbstractRenderer have the main implementation
      https://github.com/zkoss/zk/blob/master/zkbind/src/org/zkoss/bind/impl/AbstractRenderer.java#L91-L118
      ChildrenBindingRenderer have a specialized implementation
      https://github.com/zkoss/zk/blob/1e82bea329ea6d627aafb435ed192e1afb85c7e5/zkbind/src/org/zkoss/bind/impl/BindChildRenderer.java#L169-L196

      Root Cause

      Workaround

      replace the hashmap by a LRUMap or any other Map implementation with a max size

            DevChu DevChu
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: