Store OutOfMemory

  1. #1

    Store OutOfMemory

    hi all
    I have this problem When Binding large data to Store


    Click image for larger version. 

Name:	132156.PNG 
Views:	100 
Size:	61.8 KB 
ID:	24266
  2. #2
    Hi @AbdallahAshour,

    I remember a similar issue happened before, but has been fixed. Though, you might face a different case.

    Could you, please, specify what Ext.NET version are you dealing with?
  3. #3
    hi @Daniil ,

    i am dealing with (Ext.NET 3.2.1)
  4. #4
    Thanks for the answer. I think the issue that I mentioned has been resolved in 3.2.1 and you are probably facing a different issue.

    Could you, please, provide a test case?
  5. #5
    hi @Daniil,
    this is sample example ,it simulate my problem with store,




    
    
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_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 runat="server">
        <title></title>
        <script type="text/javascript" language="javascript">
    
            var filldata = function () {
                App.direct.filldata({ success: function (response) { },
                    failure: function (msg) { Failure(msg, 'Error '); }
                });
            }
    
            var filldataTest2 = function () {
                App.direct.filldataTest2({ success: function (response) { },
                    failure: function (msg) { Failure(msg, 'Error '); }
                });
            }
            
            var Failure = function (msg, strTitel) {
                Ext.Msg.show({
                    title: strTitel
                   , msg: Ext.util.Format.ellipsis(msg, 2000)
                   , icon: Ext.Msg.ERROR
                   , buttons: Ext.Msg.OK
                   , minWidth: 1200 > String(msg).length ? 360 : 600
                });
                var t = setTimeout("Ext.net.Mask.hide();", 1000);
            };
        
        </script>
    
    
            <script runat="server">
            protected void Page_Load(object sender, EventArgs e)
            {
                if (!X.IsAjaxRequest)
                {
                    int columns = 100;                
                    Model m = new Model();
                    Store1.Model.Add(m);
    
    
                    for (int c = 0; c < columns; c++)
                    {
                        string name = "Field" + c;
                        m.Fields.Add(name);
                        GridPanel1.ColumnModel.Columns.Add(new Column { DataIndex = name, Text = name });
                    }
                }
            }
    
    
            protected void Store1_ReadData(object sender, StoreReadDataEventArgs e)
            {
                try
                {
                    int rows = 200000;
                    int columns = 100;
                    //List<object> data = new List<object>(rows);
    
                    System.Data.DataTable dt = new System.Data.DataTable();
    
                    for (int c = 0; c < columns; c++)
                    {
                        dt.Columns.Add("Field" + c);
                    }
    
                    for (int r = 0; r < rows; r++)
                    {
                        //Dictionary<string, string> rowData = new Dictionary<string, string>();
                        System.Data.DataRow dr = dt.NewRow();
                        for (int c = 0; c < columns; c++)
                        {
                            string name = "Field" + c;
                            //rowData[name] = string.Format("Cell_{0}_{1}", r, c);
                            dr[name] = string.Format("Cell_{0}_{1}", r, c);
    
                        }
                        dt.Rows.Add(dr);
    
                        // data.Add(rowData);
                    }
    
    
                    Store1.Data = dt;
                    Store1.DataBind();
                }
                catch (Exception ex)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title = "Er",
                        Message = ex.Message.ToString(),
                        Buttons = MessageBox.Button.OK,
                        Icon = MessageBox.Icon.WARNING,
                    });
                }
            }
    
    </script>
    
    
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Gray">
        <Listeners>
                <BeforeAjaxRequest Handler="Ext.net.Mask.show({msg:'Loading... '});" />
                <AjaxRequestComplete Handler="Ext.net.Mask.hide();" />
                <AjaxRequestException Handler="Ext.net.Mask.hide();" />
            </Listeners>
        </ext:ResourceManager>
    
    
        <div>
    
            
            <table>
                
                 <tr>
                    <td>
                    <ext:Button ID="Button1" runat="server" Text="get 22" Icon="PageExcel">
                                <Listeners>
                                    <Click Handler="filldataTest2();" />
                                </Listeners>
                            </ext:Button>
                    </td>
                </tr>
    
                 <tr>
                     <td>
                         <ext:GridPanel ID="GridPanel1" Height="600" Width="1000" runat="server" Title="Grid">
                             <Store>
                                 <ext:Store runat="server" ID="Store1" OnReadData="Store1_ReadData">
                                     <Proxy>
                                         <ext:PageProxy />
                                     </Proxy>
                                 </ext:Store>
                             </Store>
                             <Plugins>
                                 <ext:BufferedRenderer ID="BufferedRenderer1" runat="server" />
                             </Plugins>
                             <ColumnModel ID="ColumnModel1" runat="server">
                             </ColumnModel>
    
    
                            <%-- <BottomBar>
                                <ext:PagingToolbar ID="gpNofunctionPagingToolBar" runat="server" PageSize="10" HideRefresh="true"
                                    StoreID="Store1">
                                    <Plugins>
                                        <ext:ProgressBarPager runat="server" ID="ProgressBarPager1Nofunction">
                                        </ext:ProgressBarPager>
                                    </Plugins>
                                </ext:PagingToolbar>
                            </BottomBar>--%>
    
                         </ext:GridPanel>
                     </td>
                 </tr>
            </table>
        </div>
        </form>
    </body>
    </html>

    thank you
  6. #6
    Thank you.

    I am able to reproduce OutOfMemoryException without Ext.NET. A resulting object is just too huge.

    Example
    <%@ Page Language="C#" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                int rows = 200000;
                int columns = 100;
    
                System.Data.DataTable dt = new System.Data.DataTable();
    
                for (int c = 0; c < columns; c++)
                {
                    dt.Columns.Add("Field" + c);
                }
    
                for (int r = 0; r < rows; r++)
                {
                    System.Data.DataRow dr = dt.NewRow();
    
                    for (int c = 0; c < columns; c++)
                    {
                        string name = "Field" + c;
                        dr[name] = string.Format("Cell_{0}_{1}", r, c);
    
                    }
    
                    dt.Rows.Add(dr);
                }
            }
            catch (Exception ex)
            {
                this.Label1.Text = ex.Message;
            }
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>OutOfMemoryException</title>
    </head>
    <body>
        <form runat="server">
            <asp:Label ID="Label1" runat="server" />
        </form>
    </body>
    </html>
  7. #7

    another Example

    hi @Mr.Daniil ,
    this another example for my problem.


    Click image for larger version. 

Name:	OutOfM.png 
Views:	61 
Size:	73.3 KB 
ID:	24288


    Thanks.
  8. #8
    I am sorry for the delay in answering.

    Well, I am afraid there is just no enough memory to process that amount of data (100000 rows x 100 columns). I don't quite see any bottleneck in a store.DataBind(); call.

Similar Threads

  1. Replies: 3
    Last Post: Feb 21, 2012, 10:49 AM
  2. Replies: 1
    Last Post: Dec 22, 2011, 6:17 AM
  3. [CLOSED] Store: Is it possible to QueryBy a store with another store?
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 03, 2011, 9:38 AM
  4. [CLOSED] Access Grid Data Store and manually store to database
    By macap in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Oct 05, 2011, 8:52 AM
  5. Replies: 1
    Last Post: Nov 01, 2010, 9:00 PM

Posting Permissions