Dynamic Iframes Memory Leak In Internet Explorer

Discussion in 'Software' started by cdmsenthil@gmail.com, Mar 28, 2008.

  1. cdmsenthil@gmail.com

    cdmsenthil@gmail.com

    Joined:
    Mar 28, 2008
    Messages:
    1
    I have an Infragistics UltrawebGrid [hierarchical grid with 3 levels]. Each Row in the grid is attached to a context menu using Infragistics CSOM [Client Side Object Model]



    Upon click on the menu, I am creating an Iframe dynamically which loads another page in the same domain [same web application] which also contains infragistics datagid [non hierarchical] populated with default data retrieved from Data Base. After creating the frame I am attaching it to the HTML DOM [Div Layer] and show it as modal popup with OK and Cancel Button. Upon click on any of the buttons, I am destroying the Iframe from DOM.

    Following are the functions I am using for Iframe Creation and Destroy.
    Code:
    //-------------------------------------------------------------------------
    
    // oSrcCtrl – Parent Control where dynamic iframe to be attached (DIV)
    // strFraId - Iframe Identifier
    //-------------------------------------------------------------------------
    
    function CreateIFrame(oSrcCtrl,strFraId) {
    
        var iframe = document.createElement("iframe");
    
        iframe.setAttribute("id", strFraId);
    
        iframe.setAttribute("scrolling", "no");
    
        iframe.setAttribute("frameBorder", "0");   
    
        oSrcCtrl.appendChild(iframe);
    
    }
    
    //-------------------------------------------------------------------------
    
    // oSrcCtrl – Parent Control where dynamic iframe to be attached (DIV)
    // strFraId - Iframe Identifier
    //-------------------------------------------------------------------------
    function DestroyIframeById(oSrcCtrl, strFraId)
    
    {     
    
        if (document.all)
    
        {       
    
            document.getElementById(strFraId).src = 'javascript:false';
    
            document.all[strFraId].outerHTML = '';
    
               }else{
    
            oSrcCtrl.removeChild(document.getElementById(strFraId));
    
        }  
    
    }
    Repeatedly clicking on the menu [for iframe creation] & OK, Cancel button [for destroying iframe] causing huge performance bottleneck. The amount of memory used by the IE keeps on increasing for each clicks I.e. [Dynamic Creation of iframe and Removing the same after button click] but while unloading the page i.e. navigating to a different page the IE memory usage comes to normal.



    I would need your help to validate my JavaScript codes for Iframe creation and Remove. Also request you guys to suggest some alternate solutions to get away this memory leak.



    Note:

    1. The response time to load the iframe is not an issue; it loads with in the expected time

    2. For each Iframe request the response size is nearly 500KB [includes data retrieved from database + infragistics JavaScript resource files]
    cdmsenthil@gmail.com, Mar 28, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alfred Aspinal

    Re: IFRAMES

    Alfred Aspinal, Jan 9, 2005, in forum: Computer Support
    Replies:
    0
    Views:
    493
    Alfred Aspinal
    Jan 9, 2005
  2. Larry Hoffman

    IFRAMES

    Larry Hoffman, Jan 8, 2005, in forum: Computer Information
    Replies:
    6
    Views:
    1,752
    Alfred Aspinal
    Jan 9, 2005
  3. Guest

    iFrames?

    Guest, Apr 1, 2004, in forum: MCAD
    Replies:
    1
    Views:
    606
  4. Ashok

    iFrames?

    Ashok, Apr 2, 2004, in forum: MCAD
    Replies:
    0
    Views:
    404
    Ashok
    Apr 2, 2004
  5. Khem

    iFrames?

    Khem, Apr 8, 2004, in forum: MCAD
    Replies:
    0
    Views:
    456
Loading...

Share This Page