Hybrid View

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Midwest, USA
    Posts
    96
    Vote Rating
    2
    Reimius is on a distinguished road

      0  

    Default Memory Leak when Using Ext4 Sandbox and IFrame

    Memory Leak when Using Ext4 Sandbox and IFrame


    I posted this in the general forums, but haven't gotten a response. Hopefully I'll get some more help here

    Hi Everyone,

    We have a dashboard system for stats at my work and each dashboard is in an iframe (due to legacy support). So each time a person using our system wants to look at their stats, the iframe is refreshed and it loads up many Ext.grids and Flash charts all arranged in many patterns. We wanted to slowly cut over our charting system to Ext4, with the older grids still remaining on Ext3 for a time. Right after the initial release of including the Ext4 sandbox library in our dashboard system, we started getting many out of memory errors. After some time tracking down the source we created a simple scenario which can consistently cause a large memory leak.

    outer.html - this contains the iframe which loads the other page
    Code:
    <!doctype html>
    <html>    
    <head>    
    <script type="text/javascript">        
    var run = false;        
    function reloadIframe() {
        document.getElementById("myiframe").src = "inner.html";
        if(run) {
            window.setTimeout("reloadIframe();", 1000);
        }
    }
    </script>
    
    </head>
    <body>
    
    <iframe id="myiframe" width="640" height="480"></iframe><br/>
    <input type="button" value="Start" onclick="run = true; reloadIframe();"/>
    <input type="button" value="Stop" onclick="run = false;"/>
    </body>
    </html>
    inner.html
    Code:
    <!doctype html><html>    <head>
    <script type="text/javascript" src="ext-base-debug-3.2.1.js"></script>
    <script type="text/javascript" src="ext-all-debug-3.2.1.js"></script>
    <script type="text/javascript" src="ext-all-sandbox-debug-4.0.7.js"></script>
    </head>
        <body><h1>Inner Frame</h1></body>
    </html>
    We can't figure out why this is causing a memory leak, we have tried many methods of destroying the iframe and the objects within. I'm wondering if anyone else can provide insight into this memory leak.

    Our environment includes:
    Client + Server (doesn't leak if done locally)
    Tested IE9 and Firefox current (does not leak in chrome)

    And the memory leak doesn't cause an out of memory right away. Having task manager open in windows you can see the memory consumption go up by like 20mb with each refresh of the inner iframe.
    Last edited by arthurakay; 15 Mar 2012 at 8:14 AM. Reason: code formatting

  2. #2
    Sencha - Services Team arthurakay's Avatar
    Join Date
    Sep 2008
    Location
    Antioch, IL
    Posts
    1,373
    Vote Rating
    37
    arthurakay is a jewel in the rough arthurakay is a jewel in the rough arthurakay is a jewel in the rough arthurakay is a jewel in the rough

      0  

    Default


    Googling for "settimeout memory leak" i see a bunch of possibilities.

    One being this:
    - http://pavel.kuzub.com/settimeout-memory-leak

    Try not passing a string to setTimeout()... does that help?
    Arthur Kay
    Developer Relations Manager, Sencha Inc.

    Twitter | Sencha Chicago User Group

  3. #3
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Midwest, USA
    Posts
    96
    Vote Rating
    2
    Reimius is on a distinguished road

      0  

    Default


    The setTimeout is only there to run a continuous loop so you don't have to click the button over and over to see results. Our real application example does not even use that function.

  4. #4
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Midwest, USA
    Posts
    96
    Vote Rating
    2
    Reimius is on a distinguished road

      0  

    Default


    Our best guess is that somehow the Ext4 sandbox library is creating objects on the parent frame (instead of its own window scope) due to a coding mistake which would only show up in a situation like this.

  5. #5
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Midwest, USA
    Posts
    96
    Vote Rating
    2
    Reimius is on a distinguished road

      0  

    Default


    Any help on this?

  6. #6
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Midwest, USA
    Posts
    96
    Vote Rating
    2
    Reimius is on a distinguished road

      0  

    Default


    Can I have a moderator move this to bugs? Thanks,


    REQUIRED INFORMATIONExt version tested:
    • Ext 4.0.7 (Sandbox)
    • Ext 3.2.1
    Browser versions tested against:
    • IE9
    • IE8
    • FF3
    • Google Chrome (does not happen in this browser)
    DOCTYPE tested against:
    • IE9 Standards Mode
    Description:
    • We have a dashboard system for stats at my work and each dashboard is in an iframe (due to legacy support). So each time a person using our system wants to look at their stats, the iframe is refreshed and it loads up many Ext.grids and Flash charts all arranged in many patterns. We wanted to slowly cut over our charting system to Ext4, with the older grids still remaining on Ext3 for a time. Right after the initial release of including the Ext4 sandbox library in our dashboard system, we started getting many out of memory errors. After some time tracking down the source we created a simple scenario which can consistently cause a large memory leak.
    Steps to reproduce the problem:
    • Load the example
    The result that was expected:
    • No memory leak
    The result that occurs instead:
    • ~20mb memory leak on each refresh of the inner iframe
    Test Case:see code in first postHELPFUL INFORMATIONDebugging already done:
    • Remove the 4.0 sandbox and everything is fine