ICEfaces
  1. ICEfaces
  2. ICE-6984

Memory Leak when updating the outputChart component using Push

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.2-EE-GA_P02, EE-1.8.2.GA_P03
    • Fix Version/s: EE-1.8.2.GA_P04
    • Component/s: Framework, ICE-Components
    • Labels:
      None
    • Environment:
      All

      Description

      Issue description from customer:

      We are seeing errors when using the OutputChart component and having multiple browser windows or tasb from the same browser view the same page. The application is configured with "com.icesoft.faces.concurrentDOMViews" set to true and "com.icesoft.faces.synchronousUpdate" set to false.

      I have reproduced this with a simple web app with two charts on it that are being updated by a background thread once per second. With two browser windows looking at the same page, the chart images swap places, become unavailable, etc.

      Also I have noticed severe memory leaks with this type of application. Looking at the source, I see that the image resource is registered but is never released until the session expires. With a long running session, this will chew through memory.

      See file "com.icesoft.faces.webapp.http.core.ResourceDispatcher". The "registered" property (an ArrayList) is always added to, but only cleared when the session expires.

      Also see "com.icesoft.faces.webapp.http.common.standard.pathDispatcherServer". It maintains two ArrayList properties, "matchers" and "servers" that also grow without bounds in the situation.

      I understand that the requirement to have dynamic resource stay available, but in this case, the chart component is being updated. So maybe the when the chart is updated, the resource for the previous image should replace the resource or the resource name should be the constant, so that for a chart component the resource URL would remain constant but the content would change. Obviously the would require the proper caching and expiration meta data to force the browser to refetch the image.
      1. AbstractChart.java
        14 kB
        Arran Mccullough
      2. ChartResource.java
        3 kB
        Arran Mccullough
      3. ResourceDispatcher.java
        13 kB
        Arran Mccullough

        Activity

        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Ken Fyten made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Assignee Priority P1
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #28679 Wed Apr 11 11:56:36 MDT 2012 art.zambrano applied fix for ICE-6984 (from icefaces-ee-1.8.2 branch)
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/outputchart/AbstractChart.java
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/core/ResourceDispatcher.java
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/outputchart/ChartResource.java
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Assignee Adnan Durrani [ adnan.durrani ] Arturo Zambrano [ artzambrano ]
        Adnan Durrani made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Adnan Durrani made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Ken Fyten made changes -
        Assignee Priority P2 P1
        Assignee Arran Mccullough [ arran.mccullough ] Adnan Durrani [ adnan.durrani ]
        Adnan Durrani made changes -
        Assignee Adnan Durrani [ adnan.durrani ] Arran Mccullough [ arran.mccullough ]
        Ken Fyten made changes -
        Assignee Priority P2
        Assignee Mark Collette [ mark.collette ] Adnan Durrani [ adnan.durrani ]
        Ken Fyten made changes -
        Assignee Priority P3
        Arran Mccullough made changes -
        Attachment AbstractChart.java [ 13324 ]
        Ken Fyten made changes -
        Fix Version/s EE-1.8.2.GA_P04 [ 10280 ]
        Assignee Priority P3
        Assignee Mark Collette [ mark.collette ]
        Arran Mccullough made changes -
        Salesforce Case [5007000000GwdLv]
        Arran Mccullough made changes -
        Field Original Value New Value
        Attachment ChartResource.java [ 13322 ]
        Attachment ResourceDispatcher.java [ 13323 ]
        Hide
        Arran Mccullough added a comment -

        Patched ICEfaces code.

        Show
        Arran Mccullough added a comment - Patched ICEfaces code.
        Hide
        Arran Mccullough added a comment -

        Potential Fix from customer:

        I did a fix for the GA version. I will attach my files. I did see corruption in the "registered" ArrayList with multiple browser windows accessing the same page.

        The fix is to three files: ChartResource.java, AbstractChart.java, and ResourceDispather.

        I noticed that ResourceDispatcher had a "deregisterResource" method that I could use. I modified "AbstractChart.encode" to grab a hold of the previous ChartResource and then deregister that after the new ChartResource. To do so, I had to modify "ChartResource.caclulateDigest". This method uses the current time in milliseconds as part of its computation, so each time it is called, it computes and returns a different digest string. This makes the call in "ResourceDispatcher.deregisterResource" fail to find the resource since its digest is not the same as the one used when it was registered.

        Show
        Arran Mccullough added a comment - Potential Fix from customer: I did a fix for the GA version. I will attach my files. I did see corruption in the "registered" ArrayList with multiple browser windows accessing the same page. The fix is to three files: ChartResource.java, AbstractChart.java, and ResourceDispather. I noticed that ResourceDispatcher had a "deregisterResource" method that I could use. I modified "AbstractChart.encode" to grab a hold of the previous ChartResource and then deregister that after the new ChartResource. To do so, I had to modify "ChartResource.caclulateDigest". This method uses the current time in milliseconds as part of its computation, so each time it is called, it computes and returns a different digest string. This makes the call in "ResourceDispatcher.deregisterResource" fail to find the resource since its digest is not the same as the one used when it was registered.
        Arran Mccullough created issue -

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: