[CLOSED] Consuming too much memory on the server

  1. #1

    [CLOSED] Consuming too much memory on the server

    Hi!

    I verified that an application made in Ext.NET consumes much more memory than one made in ASP.NET on a Windows Server 2008 R2 Enterprise.
    I wonder if you know tell me the reason for this high consumption of memory and if there is any way to improve it.

    My application in production is coming to consume more than 1GB of memory and periodically need to recycle the pool in IIS.

    The following simple codes were used for testing.

    Form in ASP.NET
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="AppWeb.AspNET.Default" %>
    <!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">
        <title>Test ASP.NET</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:Label runat="server" ID="lblTest" />
        </div>
        </form>
    </body>
    </html>
    Form in Ext.NET
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="AppWeb.ExtNET.Default" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!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 id="Head1" runat="server">
        <title>Test Ext.NET</title>
    </head>
    <body style="padding: 10px;">
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ScriptManager1" runat="server" />
        <ext:TextField ID="txtTest" runat="server" FieldLabel="Name" />
        </form>
    </body>
    </html>

    See images of how the application Ext.NET consumes far more memory than in ASP.NET.


    0 Request:
    Click image for larger version. 

Name:	0-requests.PNG 
Views:	55 
Size:	19.5 KB 
ID:	3199
    1 Request:
    Click image for larger version. 

Name:	1-request.PNG 
Views:	46 
Size:	24.6 KB 
ID:	3200
    10 Requests:
    Click image for larger version. 

Name:	10-requests.PNG 
Views:	51 
Size:	26.9 KB 
ID:	3201
    +1000 Requests:
    Click image for larger version. 

Name:	+1000-requests.PNG 
Views:	57 
Size:	23.3 KB 
ID:	3198
    Last edited by geoffrey.mcgill; Sep 29, 2011 at 12:06 AM. Reason: [CLOSED]
  2. #2
    It's tough to say what is happening within your application that might be causing a memory leak.

    I wonder if you know tell me the reason for this high consumption of memory and if there is any way to improve it.
    If there is a memory leak, the leak would have to be found and fixed.

    Upgrading to the latest build may help improve performance.
    Geoffrey McGill
    Founder & CEO
  3. #3
    Hi,

    Okay, but the test I did with two simple forms in ASPNET and other in EXTNET, the memory consumption of application EXTNET is more than double the ASPNET application.

    And during the test I realized that the ASPNET application stop consume memory, while the EXTNET continues to grow.

    The last version I'm using is 1.1. There was some improvement in this aspect for the 1.2?

    Thanks.
  4. #4
    Hi,

    Using ANTS tools of Red Gate, took some snapshots for you to check the memory consumption is very high.
    I suspect that the rendering of components Ext.NET is consuming too much memory.
    As I said before, my Ext.NET application is consuming much more memory than a pure in ASP.NET. The ASP.NET application no more than 100MB on the server, while the time comes to EXT.NET 1GB consumption.

    You are verifying this?

    Thanks.

    Click image for larger version. 

Name:	Analysis-Memory-Profiler-Test-Login-Page.jpg 
Views:	46 
Size:	95.5 KB 
ID:	3210

    Click image for larger version. 

Name:	Session-Overview-Memory-Profiler-Test-Login-Page.jpg 
Views:	33 
Size:	92.4 KB 
ID:	3212

    Click image for larger version. 

Name:	Performance-Profiler-Test-Login-Page.jpg 
Views:	37 
Size:	103.9 KB 
ID:	3211
  5. #5
    Ext.NET toolkit consumpes more memory because it serializes widgets before rendering, parse, transform and compress (optionaly) extjs resources (we make it one time only, after that caching transformed resources)
    But I didn't see 1 GB memory consumption
    Generally, we have no ability to clear memory, it is competence of garbage collector. Also, you first who said about such memory consumption (1 GB) on the server side.

    Did you reproduce 1GB consumption with such simple sample from first post?

    The ASP.NET application no more than 100MB on the server, while the time comes to EXT.NET 1GB consumption.
    Did you test the same applications? With same server side logic?
    You said that memory is continue growing. It is normal, .NET run garbage collector will be run when it will be required and free the memory

    I will try to build complex page and perform stress testing for that page to investigate how the memory is changed
    Vladimir Shcheglov
    Sr. Developer
  6. #6
    Hi, Vladimir.

    First of all, I thank the team for the attention and support Ext.NET.

    The consumption of 1GB that is mentioned in my application. It is not the first example of the post.

    Anyway I am also investigating, as Geoffrey asked if the problem is in my application.

    I will investigate whether it may be some bug in Windows Server 2008 as well.

    Anyway, I configured the IIS application pool to recycle every 500MB.

    If you find something, let me know.

    Again, many thanks to all.
  7. #7
    Hi,

    I created complex page (1000 controls in the page) and tested it.
    The page generate ajax request to itself, for each request all 1000 controls are recreated
    1000 requests were generated. During testing memory was varying from 63 to 70 MB
    Time of testing aprx 3 hour (each request with 1000 controls recreating occupies aprx 10 sec)
    Here is my test case
    <%@ Page Language="C#" %>
    
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            for (int i = 1; i <= 10; i++)
            {
                var panel = new Ext.Net.Panel("Panel " + i);
    
    
                for (int j = 0; j < 100; j++)
                {
                    var subpanel = new Ext.Net.Panel("Panel " + i + "_" + j);
                    panel.Items.Add(subpanel);
                }
    
    
                TabPanel1.Items.Add(panel);
            }
        }
    
    
        static int requests = 0;
    
    
        protected void StubDirectHandler(object sender, DirectEventArgs e)
        {
            Button1.Text = (++requests).ToString();
            Button1.FireEvent("click");
        }
    </script>
    <!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">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            
            <ext:TabPanel ID="TabPanel1" runat="server">
                <Items>
                    <ext:Panel runat="server" Title="Active Empty Tab" />
                </Items>
            </ext:TabPanel>
    
    
            <ext:Button ID="Button1" runat="server" Text="0">
                <Listeners>
                    <AfterRender Handler="this.fireEvent('click');" />
                </Listeners>
                <DirectEvents>
                    <Click OnEvent="StubDirectHandler" />
                </DirectEvents>
            </ext:Button>
        </form>
    </body>
    </html>
    Vladimir Shcheglov
    Sr. Developer
  8. #8
    I'm going to close this thread, although the issue of Memory Consumption is obviously something we're going to follow closely and work to improve.
    Geoffrey McGill
    Founder & CEO

Similar Threads

  1. [CLOSED] [1.2] Memory
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 15, 2012, 6:31 PM
  2. Out of memory
    By theblackcat_2902 in forum 1.x Help
    Replies: 1
    Last Post: May 08, 2011, 1:09 AM
  3. [CLOSED] memory leaks
    By acrossdev in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 22, 2011, 11:10 AM
  4. Replies: 2
    Last Post: Feb 22, 2011, 6:15 PM
  5. Replies: 3
    Last Post: Jun 10, 2010, 11:59 AM

Posting Permissions