ICEfaces
  1. ICEfaces
  2. ICE-8555

ice:panelPopup leaking memory when displayed and hidden

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0, EE-3.0.0.GA
    • Fix Version/s: EE-3.2.0.BETA, EE-3.2.0.GA, 3.3
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      IE 8, Glassfish or Tomcat, any page with ice:panelPopup. Live showcase also shows issue.
    • Assignee Priority:
      P1
    • Workaround Description:
      Hide
      The simplest and quite correct workaround is to add the f:ajax or ace:ajax tag to the "Cancel" h:commandButton. This way the ICEfaces form submit is executed and ice.onElementUpdate callbacks are invoked. Also when the "Cancel" button is clicked the file upload will not proceed, this is the correct part since you don't want to upload the file but to cancel instead.
      Show
      The simplest and quite correct workaround is to add the f:ajax or ace:ajax tag to the "Cancel" h:commandButton. This way the ICEfaces form submit is executed and ice.onElementUpdate callbacks are invoked. Also when the "Cancel" button is clicked the file upload will not proceed, this is the correct part since you don't want to upload the file but to cancel instead.

      Description

      In terms of seeing a leak the showcase offers a simple test. Go to the ice:panelPopup Overview (http://icefaces-showcase.icesoft.org/showcase.jsf?grp=compatMenu&exp=popup) in IE 8. Note the starting memory, then open/close the popup 5 times.
      In my case the result looked like this:

      Initial Task Manager Memory: 32408
      Open/Close One Time: 45596
      Two: 54188
      Three: 63676
      Four: 71076
      Five: 79300
      Total Increase: 46.892mb

      If you navigate to another page in the app via the links on the left the memory will drop off. In my case clicking the panelDivider link restored the memory to 39504.

      As you can see when they AREN'T navigating this constant increase is going to be a problem.

      Similarly when looking at the page in Google Chrome you can see a huge jump in detached DOM elements. Opening the popup once and taking a Heap Snapshot revealed 11, 29, and 2019 entries. In this case the 29 entries have their Objects Count increased by 1 each time the popup is toggled again.

      Testing with the patches from ICE-8500 shows less of a leak.

      Note that a quick test using the ace:dialog demo on Showcase seems like it doesn't leak memory.
      1. FileEntryPopupTest.zip
        20 kB
        Arran Mccullough
      2. FileEntryPopupTestWAR.zip
        9.34 MB
        Arran Mccullough
      1. screenshot-01.png
        161 kB

        Activity

        Repository Revision Date User Message
        ICEsoft Public SVN Repository #32848 Mon Dec 17 15:39:21 MST 2012 mircea.toma ICE-8555 Modified Ice.modal.stop() function to clear the callbacks registered on the iframe's document and window objects (used for mouse and keyboard event draining). Also modified PanelPopupRenderer to use ice.onelementUpdate registration function for the callback that invokes Ice.modal.stop(), this way callback is invoked on before update just before the bridge will remove all updated iframes.
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/compat/components/src/main/java/com/icesoft/faces/component/panelpopup/PanelPopupRenderer.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/compat/core/src/main/javascript/extras/extras.js

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Carlo Guglielmin
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: