Results 1 to 2 of 2

Thread: Possible memory leak caused by animations

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-9181 in
  1. #1
    Sencha User
    Join Date
    Mar 2013
    Vote Rating

    Default Possible memory leak caused by animations

    I experienced problems with a continuously increasing memory footprint when I implemented the following functionality:

    • In regular interval, a table must be updated with data loaded from a server.
    • The changed cells in the table should be visualized using the highlight animation.

    I implemented this using a grid and a memory store which I reloaded in the background. Once the store was reloaded I refreshed the view and started animations on the changed cells.

    I think that the DOM-nodes representing the grid are created every time the view is refreshed. First I used to highlight the cells. This led to an always increasing memory size and DOM-node count since the GC could not collect the global cached DOM-nodes and some memory associated with it. I then changed to Ext.get which led to a constant memory footprint over time.

    Still the DOM-node count increased and led to a browser crash. I profiled the usage and found that Ext.fx.manager caches the target DOM-nodes in a global cache (targets). The approach to solve this issue was to remove an animation from the fx queue once the animation terminated. If the queue is empty at that point we also remove the animation target from the global cache which will allow the GC to collect the possibly orphaned DOM-nodes. Below you can see the diff of my change that did the trick. I am not sure if the change has any undesired side effects.

    Is there a way to force extjs to clear global caches without reloading?

    diff --git a/ext-4.1.1a/ext-all-debug-w-comments.js b/ext-4.1.1a/ext-all-debug-w-comments.js
    index 741cfd7..6d1f8c0 100755
    --- a/ext-4.1.1a/ext-all-debug-w-comments.js
    +++ b/ext-4.1.1a/ext-all-debug-w-comments.js
    @@ -63764,7 +63764,18 @@ Ext.define('Ext.fx.Manager', {
           var me = this,
           items = me.items,
           task = me.task;
    +    var  target =;
    +    var queue = me.getFxQueue(target.getId());
    +    if(queue[0] == anim){
    +        queue.pop();
    +        if(queue.length == 0){
    +            me.targets.remove(target);
    +        }
    +    }
             //Ext.log('    X removed anim ',, ', target: ',, ', frames: ', anim.frameCount, ', item count: ', items.length);

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts