[CLOSED] Memory leak

Page 1 of 4 123 ... LastLast
  1. #1

    [CLOSED] Memory leak

    Hi guys we're working on a near real-time monitor using grids and charts with some store.
    We also have a TaskManager with a periodic task to reload the store (in our sample every 5 seconds). But after 5/6 hours up and running the browser keeps more than 1 GB of memory and then it crashes. Same behavior in IE, Firefox and chrome.
    I slightly modified the Array with Paging grid sample adding a very simple task manager like this

     <ext:TaskManager ID="TaskManager1" runat="server">
            <Tasks>
                <ext:Task AutoRun="true" TaskID="servertime" Interval="1000">
                    <Listeners>
                        <Update Handler="#{Store1}.reload();" />
                    </Listeners>
                </ext:Task>
            </Tasks>
    </ext:TaskManager>
    I found the same problem (I changed the refresh interval to amplify the leak effect) in 15 minutes the memory used by Chrome passed from 136.800 to 167.736 Mb. Obviously this is a show stopper bug. Any help?
    Last edited by Daniil; May 31, 2013 at 11:42 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Please follow:
    http://forums.ext.net/showthread.php?18647

    The problem appears to be stayed in ExtJS 4 as well.

    I have found some related ExtJS 4 threads, for example, this one with the opened bug:
    http://www.sencha.com/forum/showthread.php?133759

    Hope it will be fixed by ExtJS team.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,
    I have found some related ExtJS 4 threads, for example, this one with the opened bug:
    http://www.sencha.com/forum/showthread.php?133759

    Hope it will be fixed by ExtJS team.
    Yep Daniil but the last answer in that thread is dated 26 october 2011. I don't have extjs account can you ask the team? It seems to be a very important bug

    Thanks in advance
  4. #4
    At this moment, the single workaround (may be) to reduce aount of rebind.
    Is your data changed every 5 sec? Or you rebind always (independ of data changes)?

    I suggest to check if data is changed and rebind only if required (another option to change required cells only instead whole data). For example, make ajax request to a server (not reload request), check data on the server, if data is changed then return changed to the server and pass the data to 'loadData' method of the store

    If average data changing interval is not 5 sec but 1 min it should seriously improve situation

    If real data changing interval is 5 sec but only 2-3 cells are changed then may be to update required cells instead whole data.

    If this approaches are interested then i can prepare samples
  5. #5
    Hi Vlad our data are phone calls differently aggregated using some parameters. In our "real" page we have a grid and some charts bound on three different stores. Obviously the simplest way is to reload all the data every 5 or 10 seconds but maybe a "get only changed data" approach should work.
    Instead a 1 minute refresh time is absolutely out of question.
    I'll really appreciate an example with such approach (we're working on MVC) but saying that I imagine that this bug won't be fixed ever :( and no chances to have it fixed, is it correct?

    thanks again
    mario
  6. #6
    Instead a 1 minute refresh time is absolutely out of question.
    I did not mean to refresh every 1 minute, i meant checking requests every 5 sec and rebind only if data is changed

    I imagine that this bug won't be fixed ever :( and no chances to have it fixed, is it correct?
    Unfortunatelly, I cannot guarantee that it will be fixed because we are not involved to Sencha developing process. Only Sencha team decides what bugs will be fixed and when. We can report only about issues
  7. #7
    Quote Originally Posted by Vladimir View Post
    I did not mean to refresh every 1 minute, i meant checking requests every 5 sec and rebind only if data is changed
    Yes I understood and I appreciate your help to do this with an example :)


    Quote Originally Posted by Vladimir View Post
    Unfortunatelly, I cannot guarantee that it will be fixed because we are not involved to Sencha developing process. Only Sencha team decides what bugs will be fixed and when. We can report only about issues
    I imagine but I hope you have more influence on Sencha dev team to push this bug ;)

    I look forward to get your sample over "update only changed cell" example. In your opinion the tremendous memory leak bug is in the store, grid, chart or all of them?
    Any hope to have your workaround working ? :)
  8. #8
    There are rather many related threads on Sencha forums, so ExtJS team is aware of the problem. Hopefully, they will fix it.

    Quote Originally Posted by bbo1971 View Post
    In your opinion the tremendous memory leak bug is in the store, grid, chart or all of them?
    Well, analyzing Sencha forums threads I can say that people are commonly facing this problem with grid/store.

    Quote Originally Posted by bbo1971 View Post
    I look forward to get your sample over "update only changed cell" example.
    We will prepare an example in a few days (probably, today-tomorrow).
    Last edited by geoffrey.mcgill; May 23, 2012 at 8:27 PM.
  9. #9
    Hi,

    Here is samples
    1. Update whole data if server side changes are detected
    Controller
    public ActionResult GetTestData()
    {
    	// emulation of dirty data
    	// in real project you need to check that data is changed
    	// if is not chaged need return nothing
    	// for testing, we return nothing if current scond is even
    	if(DateTime.Now.Second % 2 == 0)
    	{
    		return new AjaxResult();
    	}
    
    
    	var data = new object[]{
    		new {Value = DateTime.Now},
    		new {Value = DateTime.Now.AddHours(1)},
    		new {Value = DateTime.Now.AddHours(2)},
    		new {Value = DateTime.Now.AddHours(3)},
    		new {Value = DateTime.Now.AddHours(4)}
    	};
    
    
    	return new AjaxResult
    	{
    		ExtraParamsResponse = { 
    				new Parameter("data", JSON.Serialize(data), ParameterMode.Raw)
    			}
    	};                            
    }
    View
    <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
    <%@ Register Assembly="Ext.Net" TagPrefix="ext" Namespace="Ext.Net" %>
    
    
    <!DOCTYPE html>
    
    
    <html>
    <head runat="server">
        <title></title>
    
    
        <script type="text/javascript">
            function loadData(store, result)
            {
                var data = result && result.extraParamsResponse && result.extraParamsResponse.data;
                if(data)
                {
                    store.loadData(data);
                    Ext.MessageBox.notify("Data", "Data was changed");
                }
                else{
                    Ext.MessageBox.notify("Data", "Data was NOT changed");
                }
            }
        </script>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        
        <ext:GridPanel 
            ID="GridPanel1" 
            runat="server" 
            Title="Grid">
            <Store>
                <ext:Store ID="Store1" runat="server" AutoLoad="false">               
                    <Model>
                        <ext:Model runat="server">
                            <Fields>
                                <ext:ModelField Name="Value" Type="Date" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:DateColumn runat="server" Text="Value" DataIndex="Value" Flex="1" Format="H:mm:ss" />                       
                </Columns>
            </ColumnModel>
        </ext:GridPanel>  
    
    
        <ext:TaskManager runat="server">
            <Tasks>
                <ext:Task AutoRun="true" Interval="5000">
                    <DirectEvents>
                        <Update Url="/Examples/GetTestData" Success="loadData(#{Store1}, result)" />
                    </DirectEvents>
                </ext:Task>
            </Tasks>
        </ext:TaskManager>
    </body>
    </html>



    2. Update changed cells only
    Controller
     public ActionResult GetTestData()
            {
                return this.Content(JSON.Serialize(new object[]{
                    new {Value = DateTime.Now},
                    new {Value = DateTime.Now.AddHours(1)},
                    new {Value = DateTime.Now.AddHours(2)},
                    new {Value = DateTime.Now.AddHours(3)},
                    new {Value = DateTime.Now.AddHours(4)}
                }), "application/json");
            }
    
    
            public ActionResult UpdateCells()
            {
                var store = X.GetCmp<Store>("Store1");
                
                // in real application you have update changed only cells
                // for test, we update cell with index 1
                store.GetAt(1).Set("Value", DateTime.Now);
    
    
                return new AjaxResult();
            }
    View
    <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
    <%@ Register Assembly="Ext.Net" TagPrefix="ext" Namespace="Ext.Net" %>
    
    
    <!DOCTYPE html>
    
    
    <html>
    <head runat="server">
        <title></title>
    
    
        <script type="text/javascript">
            function loadData(store, result)
            {
                var data = result && result.extraParamsResponse && result.extraParamsResponse.data;
                if(data)
                {
                    store.loadData(data);
                    Ext.MessageBox.notify("Data", "Data was changed");
                }
                else{
                    Ext.MessageBox.notify("Data", "Data was NOT changed");
                }
            }
        </script>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        
        <ext:GridPanel 
            ID="GridPanel1" 
            runat="server" 
            Title="Grid">
            <Store>
                <ext:Store ID="Store1" runat="server">               
                    <Model>
                        <ext:Model runat="server">
                            <Fields>
                                <ext:ModelField Name="Value" Type="Date" />
                            </Fields>
                        </ext:Model>
                    </Model>
                    <Proxy>
                        <ext:AjaxProxy Url="/Examples/GetTestData">                        
                        </ext:AjaxProxy>
                    </Proxy>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:DateColumn runat="server" Text="Value" DataIndex="Value" Flex="1" Format="H:mm:ss" />                       
                </Columns>
            </ColumnModel>
        </ext:GridPanel>  
    
    
        <ext:TaskManager runat="server">
            <Tasks>
                <ext:Task AutoRun="true" Interval="5000">
                    <DirectEvents>
                        <Update Url="/Examples/UpdateCells" />
                    </DirectEvents>
                </ext:Task>
            </Tasks>
        </ext:TaskManager>
    </body>
    </html>
  10. #10
    Thanks a lot Vlad I'll try it in the next week. I'll post the results of my tests and my impression

    Bye
Page 1 of 4 123 ... LastLast

Similar Threads

  1. [CLOSED] [1.0] Performance in IE6 (memory leak?)
    By danielg in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Apr 27, 2012, 2:57 PM
  2. Memory Leak with Grid Local Filter
    By reverseblade in forum 1.x Help
    Replies: 1
    Last Post: Apr 27, 2011, 10:00 AM
  3. Memory leak desktop application
    By Yannis in forum 1.x Help
    Replies: 0
    Last Post: Apr 05, 2011, 3:47 AM
  4. TaskManager cause IE memory leak
    By Tom Zhang in forum 1.x Help
    Replies: 1
    Last Post: Sep 19, 2010, 5:32 AM
  5. Memory Leak in I.E.
    By crazypsdev in forum 1.x Help
    Replies: 6
    Last Post: Nov 09, 2009, 9:55 AM

Tags for this Thread

Posting Permissions