Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.
  1. #1
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    974
    Vote Rating
    108
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      1  

    Default [4.2.1 GA] Store reload causes memory leaking

    [4.2.1 GA] Store reload causes memory leaking


    REQUIRED INFORMATION

    Ext version tested:
    • Ext 4.2.1 GA
    Browser versions tested against:
    • Chrome 27.0.1453.94 m - FAIL
    • IE9 9.0.8112.16421 (update 9.0.15 (KB2817183)) - FAIL
    • FireFox 21.0 - OK
    DOCTYPE tested against:
    • <!DOCTYPE html>
    Description:
    • Store reload causes memory leaking in IE9 and Chrome. FireFox seems fine. The test case below gives:
    Chrome : + ~100 MB in ~10-15 minutes
    IE9: + ~ 250 in IE9 in ~10-15 minutes
    FireFox: seems, no memory leaking at all
    • Related ExtJS 3 bug report:
    Steps to reproduce the problem:
    • Run the test case in Chrome and IE9, notice the consumed memory in TaskManager
    • Wait 10-15 minutes
    • Notice the consumed memory in TaskManager
    The result that was expected:
    • The consumed memory equals to or about of the initial state
    The result that occurs instead:
    • Memory leaks
    Test Case:

    Code:
    <!DOCTYPE html>
    <html>
    <head>
        <title>Store reload causes memory leaks</title>
    
        <link type="text/css" rel="stylesheet" href="../resources/css/ext-all.css" />
    
        <script type="text/javascript" src="../ext-all-debug.js"></script>
    
        <script type="text/javascript">
            Ext.Loader.setPath('Ext.ux', '../examples/ux');
            Ext.require([
                'Ext.ux.ajax.SimManager'
            ]);
    
            Ext.onReady(function () {
                var data = [],
                    i;
    
                for (i = 0; i < 1000; i++) {
                    data[i] = { test: "test_" + i }
                }
    
                Ext.ux.ajax.SimManager.register({
                    'remote-data.php' : {
                        stype: 'json',
                        data: data
                    }
                });
    
                window.myGrid = Ext.create("Ext.grid.Panel", {
                    renderTo: Ext.getBody(),
                    height: 200,
                    width: 200,
                    store: {
                        autoLoad: true,
                        pageSize: 1000,
                        fields: [{
                            name: "test"
                        }],
                        proxy: {
                            type: 'ajax',
                            url: 'remote-data.php',
                            reader: {
                                type: 'json',
                                root: 'data'
                            }
                        }
                    },
                    columns: {
                        items: [{
                            text: "Test",
                            dataIndex: "test"
                        }]
                    }
                });
    
                setInterval("window.myGrid.store.reload()", 2000);
            });
        </script>
    </head>
    <body>
    
    </body>
    </html>
    HELPFUL INFORMATION

    Operating System:
    • Windows 7 SP1 64bit
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,800
    Vote Rating
    167
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    974
    Vote Rating
    108
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      1  

    Default


    Hi @slemmon,

    Could you shed some light on the status of the issue? Is it being considered as a severe one? It looks a 100% showstopper for applications which reload stores. Is there any time frame? Any findings?
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  4. #4
    Sencha User
    Join Date
    Oct 2007
    Location
    Gatineau, QC, Canada
    Posts
    4
    Vote Rating
    0
    vgvallee is on a distinguished road

      0  

    Default


    Was anything done regarding this issue?

  5. #5
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,647
    Vote Rating
    583
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      3  

    Default


    Looking at the memory usage in the task manager isn't necessarily relevant when talking about a memory leak:

    1) That's the whole browser process, including all the extra parts, not just the JS engine
    2) The garbage collector doesn't necessarily respond to us deallocating memory. Just because you set an object reference to null doesn't mean the process will free memory straight away, there's a whole bunch of "magic" behind how the GC runs.

    I ran the test case for around ~10 minutes taking snapshots of the heap along the way. Chrome doesn't seem to indicate any appreciable increase in memory usage (see the attachment).

    A better way to analyze this would be to modify the test case slightly:

    Code:
    Ext.Loader.setPath('Ext.ux', '../SDK/extjs/examples/ux');
    Ext.require(['*', 'Ext.ux.ajax.SimManager']);
    
    Ext.onReady(function() {
        var data = [], i;
    
        for ( i = 0; i < 10000; i++) {
            data[i] = {
                test: "test_" + i
            }
        }
    
        Ext.ux.ajax.SimManager.register({
            'remote-data.php': {
                stype: 'json',
                data: data
            }
        });
    
        var grid = new Ext.grid.Panel({
            renderTo: Ext.getBody(),
            height: 200,
            width: 200,
            bbar: [{
                text: 'Go',
                handler: function() {
                    grid.getStore().reload();
                }
            }],
            store: {
                autoLoad: true,
                pageSize: 10000,
                fields: [{
                    name: "test"
                }],
                proxy: {
                    type: 'ajax',
                    url: 'remote-data.php',
                    reader: {
                        type: 'json',
                        root: 'data'
                    }
                }
            },
            columns: [{
                text: "Test",
                dataIndex: "test"
            }]
        });
    });
    Let the grid load, take a snapshot to get a baseline. Then:
    Code:
    for (;;) {
        pressGo();
        takeSnapshot();
    }
    Inspecting the object graph, it doesn't seem to be holding onto any references it shouldn't.
    Attached Images
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  6. #6
    Sencha User
    Join Date
    Dec 2013
    Posts
    6
    Vote Rating
    0
    jreusser is on a distinguished road

      0  

    Default Memory Leak Still Exists

    Memory Leak Still Exists


    Hello,I am currently working on a (rather large) Ext JS 4.2.1 project. We are reloading a store, which is loaded through JSON and a rest proxy. Our data sets are rather large. I can confirm that this issue is still extant.

    It's even a problem in your example: http://docs.sencha.com/extjs/4.2.2/#!/example/restful/restful.html

    I set a break point at the beginning of the restufl.js file in chrome's dev tools, and inserted the following into the docked items;

    Code:
    ,{                itemId: 'load',                text: 'load',                handler: function(){ store.load();}}
    Then, i proceeded to press the button, multiple times. I've attatched my stack heap snapshots, taken, with 20-50 presses in between each.


    I'd say the problem still exists. Is there any indication of when we can expect to see this issue resolved?
    Attached Images

  7. #7
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    974
    Vote Rating
    108
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    Hi Evan,

    Thank you for the input! And apologize for such the delay in responding.

    I do agree with your points that the TaskManager is not a solid way to analyze memory leaking and there is a bunch of magic in GC. But if there are +100 MB in Chrome and +250 MB in IE9 in 10 minutes, I think it is very unlikely that a problem in TaskManager or GC. Yes, there is a chance that there is something wrong with browsers. Moreover, I was unable to reproduce the problem with FireFox. But it is hard to believe Chrome is that worse here.

    Indeed, with your approach (making heap snapshots), I don't see a memory increase. But I still see +100 for the Chrome process.

    I see the [FNR] tag for the thread. Probably, "fixed in next release". Really? Have some work been put on that issue or is it a joke by your tracking system? If fixed, then please clarify in which release will it appear?
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  8. #8
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,647
    Vote Rating
    583
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    The ticket has been marked as cannot reproduce.

    As I said previously, just because the task is consuming memory doesn't mean there is a memory leak. Chrome is reporting the reachable objects in the heap profiler and it's demonstrating that it's not growing out of control.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  9. #9
    Sencha User
    Join Date
    Dec 2013
    Posts
    6
    Vote Rating
    0
    jreusser is on a distinguished road

      0  

    Default


    Quote Originally Posted by evant View Post
    The ticket has been marked as cannot reproduce.

    As I said previously, just because the task is consuming memory doesn't mean there is a memory leak. Chrome is reporting the reachable objects in the heap profiler and it's demonstrating that it's not growing out of control.
    Given that this does seem to be a problem that the rest of the community can reproduce, perhaps Sencha could post some tips on avoiding memory leaks, specifically in Ext JS grid/store combinations.

  10. #10
    Sencha Premium Member Oliver Timm's Avatar
    Join Date
    Jan 2013
    Location
    Berlin
    Posts
    6
    Vote Rating
    2
    Oliver Timm is on a distinguished road

      0  

    Default


    Why do you mark this ticket as cannot reproduce? As you can see in the attachments the memory increases a lot in approximately 15 min. I only have one grid with a xml store which reloads every 5 sec.

    2014-06-26 15_28_38-Windows Task-Manager.png2014-06-26 15_41_55-Windows Task-Manager.png