473,221 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,221 software developers and data experts.

Dynamic Iframe (inside ModalPopUpControl ) Memory Leak In Internet Explorer

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 points to 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 inside an ModalPopUpControl Extender. Upon click on any of the buttons, I am destroying the Iframe from DOM. I am calling ModalPopUpControl show() and hide() methods for displaying and canceling modal popup.

Following are the functions I am using for Iframe Creation and Destroy.
Expand|Select|Wrap|Line Numbers
  1.  
  2.     //----------------------------------------------------------------------------------------------------
  3.  
  4.     // oSrcCtrl  Parent Control where dynamic iframe to be attached (DIV)
  5.     // strFraId - Iframe Identifier
  6.     //-----------------------------------------------------------------------------------------------------
  7.  
  8.     function CreateIFrame(oSrcCtrl,strFraId) {
  9.  
  10.         var iframe = document.createElement("iframe");
  11.  
  12.        iframe.setAttribute("id", strFraId);
  13.  
  14.        iframe.setAttribute("scrolling", "no");
  15.  
  16.        iframe.setAttribute("frameBorder", "0");   
  17.  
  18.        oSrcCtrl.appendChild(iframe);
  19.  
  20.    }
  21.  
  22.    //--------------------------------------------------------------------------------------------------------
  23.  
  24.    // oSrcCtrl  Parent Control where dynamic iframe to be attached (DIV)
  25.    // strFraId - Iframe Identifier
  26.    //---------------------------------------------------------------------------------------------------------
  27.    function DestroyIframeById(oSrcCtrl, strFraId)
  28.    {    
  29.  
  30.        if (document.all)
  31.  
  32.        {       
  33.  
  34.            document.getElementById(strFraId).src = 'javascript:false';
  35.  
  36.            document.all[strFraId].outerHTML = '';
  37.  
  38.               }else{
  39.  
  40.            oSrcCtrl.removeChild(document.getElementById(strFraId));
  41.  
  42.        }  
  43.  
  44.    }
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.

I Just downloaded Javascript Memory leak detector from http://blogs.msdn.com/gpde/pages/jav...-detector.aspx and yet to profile my code, once i am done with that I'll update this post with my results and in the mean time i would appreciate any help. Showing and Hiding ModalPopUpControl using javascript code (behaviour.show() & behaviour.hide()) will casue any 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]
Mar 29 '08 #1
1 4832
acoder
16,027 Expert Mod 8TB
Instead of continuously creating and destroying iframes, reuse the same one(s).

If you must, consider a timeout too to allow the frame to be removed.

Another tool for detecting leaks is Drip.
Jun 7 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Mark D. Anderson | last post by:
About a month ago Richard Cornford did an interesting analysis of a memory leak in jscript (internet explorer) when there are "circular" references between DOM objects and (real) jscript objects:...
4
by: Keon | last post by:
Hoi Do someone know how i can make the background of a iframe transparancy? I already tried it with filter: Alpha(Opacity=50,); but it also make the text transperancy. do someone know how to...
10
by: s.subbarayan | last post by:
Dear all, I happen to come across this exciting inspiring article regarding memory leaks in this website: http://www.embedded.com/story/OEG20020222S0026 In this article the author mentions:...
3
by: Stevie_mac | last post by:
It might be me but... I dont seem to get a Page_Load event when a opening an ASPX in an iFrame. I do geta Page_Load event when an item on the ASPX (inside the iFrame) is clicked but then...
2
by: m0nkeymafia | last post by:
I have spent the past few weeks trying to figure a way around this problem, and have yet to find a good enough solution. Internet Explorer leaks memory when I update a div container using...
28
by: Larax | last post by:
Best explanation of my question will be an example, look below at this simple function: function SetEventHandler(element) { // some operations on element element.onclick = function(event) {
8
by: BillE | last post by:
I have an existing asp.net 2.0 webforms app using master/content pages, and it works fine. I added some Ajax elements, including some UpdatePanels and modal PopUp panels which contain asp.net...
3
by: ysakaed | last post by:
Hi I am trying to get the content of the iframe to replace the content inside a div here is the code i use. function changeContent(content) { var buf = content + "_2"; var iframe =...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.