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

Abstract renderer stores rendered item index indefinitely

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.6.0.1
    • Fix Version/s: 8.6.1
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None
    • gh.sprint.customfield.default.name:
      ZK 8.6.1 S1

      Description

      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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: