It looks like there is a memory leak in Ext 4.2 when using associations. I've created a simple page which creates one model with a has many association & on clicking a button uses the store loadRawData api to load it in.

    var userDataSet = [], storeToTest;

        id: 1,
        orders: [{
            id: 1

    Ext.define('User', {
        extend: 'Ext.data.Model',
        fields: ['id'],

        hasMany: {model: 'Order', name: 'orders'}

    Ext.define('Order', {
        extend: 'Ext.data.Model',
        fields: ['id']

    Ext.define('UserStore', {
        extend: 'Ext.data.Store',
        model: 'User'

    storeToTest = new UserStore();

    function doStoreLoad() {
        document.getElementById('count').innerHTML = Ext.StoreMgr.getCount();
(running version at: http://jsbin.com/opakuz/1/edit)

I've run this in chrome and taken several heap dump, whilst clicking & adding a new set of data to the store. As you can see in the below screenshots of the profiler the number of objects between each subsequent load of the store goes up by 43 Objects each time. This seems a little too consistent and sounds like it could be a bug in the framework. I know we've certainly had memory issues with Ext and Associations, but I've not been able to pin point the issue.


Difference between snapshot 2 & 3


Difference between snapshot 3 & 4


Difference between snapshot 4 & 5

Note I've also forced a GC inbetween calls.

Is there a known memory leak when using associations?