This is a migrated thread and some comments may be shown as answers.

[Solved] radWindow memory leaking?

11 Answers 414 Views
Window
This is a migrated thread and some comments may be shown as answers.
Remko
Top achievements
Rank 1
Remko asked on 02 Mar 2008, 12:23 PM

Is there something wrong with my method of initiating a server side radAlert?
Each time i press button1, the memory for iexplore.exe jumps up a few K, and every time thereafter. So it only takes a dozen or so clicks to go from 30K->70K. If I replace the RadAlert with a normal javascript alert in the code there is no problem.


ajax aspx page

<asp:Label ID="Label1" runat="server" Text="Click 'New' button as many times as you want to add new items and then click 'Save' to udpated the CheckBoxList"></asp:Label>

<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button_Click"/>

<asp:Button ID="Button2" runat="server" Text="Button" OnClick="Button_Click"/>

<asp:CheckBoxList ID="CheckBoxList1" runat="server" style="z-index: 101; left: 251px; position: absolute; top: 91px" Height="51px" Width="26px">

<asp:ListItem>1</asp:ListItem>

<asp:ListItem>2</asp:ListItem>

</asp:CheckBoxList>

<asp:ListBox ID="ListBox1" runat="server" style="z-index: 102; left: 204px; position: absolute; top: 87px" Height="191px" Width="34px">

<asp:ListItem>1</asp:ListItem>

<asp:ListItem>2</asp:ListItem>

</asp:ListBox>

<telerik:RadAjaxManager ID="TelerikjaxManager1" runat="server" OnResolveUpdatedControls="AjaxManager1_ResolveUpdatedControls" OnAjaxSettingCreated="TelerikjaxManager1_AjaxSettingCreated" OnAjaxSettingCreating="TelerikjaxManager1_AjaxSettingCreating">

<AjaxSettings>

<telerik:AjaxSetting AjaxControlID="Button1">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="Button1" />

<telerik:AjaxUpdatedControl ControlID="ListBox1" />

<telerik:AjaxUpdatedControl ControlID="TextBox1" />

</UpdatedControls>

</telerik:AjaxSetting>

<telerik:AjaxSetting AjaxControlID="Button2">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="Button2" />

<telerik:AjaxUpdatedControl ControlID="CheckBoxList1" />

<telerik:AjaxUpdatedControl ControlID="TextBox2" />

</UpdatedControls>

</telerik:AjaxSetting>

</AjaxSettings>

</telerik:RadAjaxManager>

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="WebBlue" Animation="None" Behavior="Default" Behaviors="Default" InitialBehavior="None" InitialBehaviors="None" Left="" Top="">

<Windows>

</Windows>

</telerik:RadWindowManager>

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>

Code behind is:

protected void Button_Click(object sender, EventArgs e)

{

TextBox1.Text =

"";

TextBox2.Text =

"";

switch (((Button) sender).ID)

{

case "Button1":

{

ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "RadAlertScript", "radalert('test');", true);

ListBox1.Items.Add(

new ListItem((ListBox1.Items.Count + 1).ToString()));

updateControlID =

"ListBox1";

TextBox1.Text =

"Button1";

TextBox2.Text =

"Button2";

break;

};

case "Button2":

{

for (int i = CheckBoxList1.Items.Count; i < ListBox1.Items.Count; i++)

{

CheckBoxList1.Items.Add(

new ListItem((i + 1).ToString()));

}

updateControlID =

"CheckBoxList1";

TextBox1.Text =

"Button1";

TextBox2.Text =

"Button2";

break;

}

}

}

11 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 07 Mar 2008, 05:21 PM
Hello Kevin,

We examined the reported issue and you are right about the memory leaks. Since it is not good for the control in this scenario, we logged the problem in our ToDo list with high priority and it will be fixed soon. Thank you for reporting this, your points are updated.

Kind regards,
George
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Stephen Thornton
Top achievements
Rank 1
answered on 28 Apr 2008, 03:08 PM
just wondering if this memory leak has been fixed yet, as i am seeing something similar at the moment with repeated use of the radwindow component.

thanks
0
Georgi Tunev
Telerik team
answered on 30 Apr 2008, 01:07 PM
Hi Stephen,

Can you please provide more details about your exact scenario? What is your setup and the behavior that you experience?



All the best,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Michael
Top achievements
Rank 1
answered on 23 Jun 2008, 01:13 AM
I'm also noticing a memory leak with the rad window when viewing in Sieve and Drip.

Here is my calling code:

Button calling java script:
<asp:ImageButton ID="ButtonPostMessage" runat="server" OnClientClick="popDiscussion(); return false;" ImageUrl="~/images/btn_postmessage_off.gif" />
 
Rad window declaration:
<telerik:RadWindow ID="RadWindowDiscussion" runat="server" Width="300px" Height="230px" Animation="None" Behaviors="Close" InitialBehaviors="None" IntialBehavior="None" Modal="true" VisibleStatusbar="false" ReloadOnShow="true"OnClientClose="popDiscussion_Close"                ClientCallBackFunction="popDiscussion_CallBackFunction">
</telerik:RadWindow>

Javascript supporting functions:
function popDiscussion()
{
    /* Stop asp timer */
    stopTimer();

    var url = 'DiscussionEntry.aspx'
    var oWnd = $find("RadWindowDiscussion");
    oWnd.setUrl(url)
    oWnd.show()
    oWnd.center();
}

function popDiscussion_Close()
{
    /* Start asp timer */
    startTimer();
}

function popDiscussion_CallBackFunction(radWindow, returnValue)
{
    if (returnValue == "Saving")
        __doPostBack('UpdatePanel1', 'RowAdded');       
}

And here is the asp for the web page that is being called:

<%@ Page Language="C#" AutoEventWireup="true" Codebehind="DiscussionEntry.aspx.cs"
    Inherits="Feeds247.Web.Application.DiscussionEntry" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<style type="text/css">html {overflow-y:scroll;}</style>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link href="./css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"
            LoadScriptsBeforeUI="false" ScriptMode="Release" />

        <script language="javascript" type="text/javascript">

function getRadWindow()  
{  
    var oWindow = null;  
    if (window.radWindow) oWindow = window.RadWindow; //Will work in Moz in all cases, including clasic dialog  
    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz az well)  
    return oWindow;            
}  
 
function cancel_Clicked()  
{  
    var oWindow = getRadWindow();           
    oWindow.Close();
}      

function save_Clicked()
{
    var oWindow = getRadWindow();
   
    //Get current content of text area
    var oNewText = "Saving";
   
    //Variant1: Passing the argument to the Close method will result in the same behavior
    oWindow.Close(oNewText);
}

function swapButtons(name, direction, type)
{
    switch(direction)
    {
        case 'in':
        {
            switch(type)
            {
                case 'save':
                name.src="./images/btn_save_on.gif";
                break;
                case 'cancel':
                name.src="./images/btn_cancel_on.gif";
                break;
            }
           
            break;
        }
       
        case 'out':
        {
            switch(type)
            {
                case 'save':
                name.src="./images/btn_save_off.gif";
                break;
                case 'cancel':
                name.src="./images/btn_cancel_off.gif";
                break;
            }
           
            break;
        }       
    }
}
        </script>

        <div id="allDiscussionEntry">
            <div id="contentDiscussionEntry">
                <asp:Label ID="lblEnterMsg" runat="server" Text="Enter Message" Font-Size="X-Small"
                    ForeColor="White"></asp:Label>
                <br />
                <telerik:RadTextBox ID="TextBoxDiscussionEntry" runat="server" TextMode="MultiLine"
                    ToolTip="Enter your discussion message here." CssClass="discussionEntry" Wrap="true"
                    Width="285px" Height="140px" BackColor="#E2EBf3" Font-Size="10px">
                </telerik:RadTextBox>
            </div>
            <div id="footerDiscussionEntry">
                <asp:ImageButton ID="ButtonSaveMessage" runat="server" OnClick="ButtonSaveMessage_Click"
                    ImageUrl="~/images/btn_save_off.gif" />
                <asp:ImageButton ID="ButtonCancelMessage" runat="server" ImageUrl="~/images/btn_cancel_off.gif"
                    OnClientClick="cancel_Clicked(); return false;" />
            </div>
        </div>
    </form>
</body>
</html>

0
Georgi Tunev
Telerik team
answered on 23 Jun 2008, 02:54 PM
Hello Michael,

Are you testing with IE6 or IE7? I am asking you this because we've managed to fix all memory leaks in RadWindow for ASP.NET AJAX, but there is still one in IE6 which comes from the way IE6 handles IFRAMEs (RadWindow is basically an IFRAME).

I suggest to update to the latest version of RadWindow for ASP.NET AJAX and if you are using IE7 and still experience memory leaks - to send us a full, working project where they can be observed. We will check it and get back to you right away.



Kind regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Buffet
Top achievements
Rank 1
answered on 23 Jun 2008, 11:56 PM
Hi Georgi

I encountered the same problem for both RadWindow and RadGrid's EditItem's Popup mode.

The problems exist in the following browers:

IE6
IE7
Firefox 2
Firefox 3
Safari 312 for Win

Please help.
0
Buffet
Top achievements
Rank 1
answered on 24 Jun 2008, 12:06 AM
Sorry it does NOT happen in FF 3.
0
Michael
Top achievements
Rank 1
answered on 24 Jun 2008, 07:03 PM
This leak occurs in both IE6 and IE7 with the latest prometheus build.
0
Buffet
Top achievements
Rank 1
answered on 25 Jun 2008, 12:07 AM
Hi Telerik

Is there any immediate temporary work around or fix for this?

Thanks
0
Buffet
Top achievements
Rank 1
answered on 25 Jun 2008, 12:47 AM
Hi

I suspect the following problem is related to this memory leak issue.

I initialise and open a RadWindow from codebehind in a Menu's ItemClick event handler. The RadWindow is managed by a RadWindowManager in the aspx file. Also there is a RadAjaxManager in which the RadMenu initiates the  RadWindowManager (UpdatedControls). It also connects to a RadAjaxLoadingPanel to display the loading progress.

Problem:

When I click the X to close the RadWindow and then click on the same MenuItem again to redisplay the same RadWindow, the LoadingImage keeps on displaying indicating that the Ajax request is still processing. There is no way for me to stop it.

So I close the browser (IE7), open a new browser, access the same page and click the same MenuItem again, this time, the LoadingImage comes on and stays on persistently. If I repeat this testing process, all new browsers subsequently have the LoadingImage stay on displaying.

The only way I can get rid of it is to clear IE's Temporary Internet Files (through Delete Browsing History) so the new browser can start fresh.

I open the window in the following manner:
switch (ItemClicked.Value)
case "TestWindow":
RadWindow w = new RadWindow();
w.NavigateUrl = "~/TestWindow.aspx";
w.VisibleOnPageLoad = true;
w.DestroyOnClose = true;
windowManager.Windows.Add(w);

....

Did I do anything wrong or it's the memory leak that keep the window instant on the browser's cache?

Please help.

Thanks.
0
Georgi Tunev
Telerik team
answered on 26 Jun 2008, 12:08 PM
Hello Buffet,

Can you please try setting the DestroyOnClose property to true for the RadWindow that you are opening via the menu? When you set it to true, the RadWindow's object will be destroyed once the window is closed.

If you still experience problems however, it will be best to open a support ticket and to send me your project so I can check it.


Sincerely yours,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Window
Asked by
Remko
Top achievements
Rank 1
Answers by
George
Telerik team
Stephen Thornton
Top achievements
Rank 1
Georgi Tunev
Telerik team
Michael
Top achievements
Rank 1
Buffet
Top achievements
Rank 1
Share this question
or