Opened 8 years ago

Closed 8 years ago

#12037 closed defect (fixed)

Memory leak using setStore() on dojox.grid.DataGrid

Reported by: irialcon Owned by: evan
Priority: high Milestone: 1.6
Component: DojoX Grid Version: 1.4.3
Keywords: memory leak datagrid setStore Cc: irialcon@…, xwzhu@…
Blocked By: Blocking:

Description

Hi,

We use dojox.grid.DataGrid? with dojo.data.ItemFileWriteStore?. We are seeing a large memory leak when we set the store repeatedly [using setStore()]. We have replicated this result several times.

I have seen some similar tickets, but none that fully match:

http://trac.dojotoolkit.org/ticket/11310 (ours is different as we also see the issue on FF)
http://trac.dojotoolkit.org/ticket/11370 (we have a different store implementation..)
http://trac.dojotoolkit.org/ticket/9868

The attached file memoryLeakTest.html contains a much stripped down version of our actual code.

Other points to note

  • In our actual code we update a table at 20 second intervals (with JSON data retrieved from an AJAX request) but we see the same issue , albeit over a longer period
  • If we comment out the setStore(..) line in the attached example, no memory leak is seen
  • Same behaviour seen on FF 3.5.6 and IE 8
  • We have tried the following, but in each case they don't alleviate the memory leak

-- replace ItemFileWriteStore? with ItemFileReadStore?
-- create datagrid programmatically
-- invoke store.close after setStore(..)
-- etc

Any help appreciated as this is a blocking issue for us.

Regards, Irial

Attachments (3)

memoryLeakTest.html (3.2 KB) - added by irialcon 8 years ago.
memory leak test
datagrid-#12037.patch (1.8 KB) - added by evan 8 years ago.
Fix from Oliver(IBM, CCLA), the patch fixes the major leaks(dom node), however there's still a very slow leak when running for a long time. Still need a further look.
memoryLeakTest_evan.html (3.8 KB) - added by evan 8 years ago.
Made some trivial changes to the test case and the average memory usage is stable in FF3.5/3.6. The test case is changed by strictly following http://docs.dojocampus.org/dojo/data/ItemFileReadStore#reloading-refreshing-itemfilereadstore-from-a-data-object-dojo-toolkit-1-4 for resetting datastore

Download all attachments as: .zip

Change History (10)

Changed 8 years ago by irialcon

Attachment: memoryLeakTest.html added

memory leak test

comment:1 Changed 8 years ago by irialcon

Additonal Info: As this is a blocking issue for us I also posted a question on the forum and have progressed somewhat with the info we have garnered there: http://dojo-toolkit.33424.n3.nabble.com/Memory-leak-using-setStore-on-dojox-grid-DataGrid-td2035356.html

However, we are now essentially avoiding the issue - there still remains an actual memory leak that needs to be addressed.

comment:2 Changed 8 years ago by bill

Owner: changed from bryanforbes to Bryan Forbes

comment:3 Changed 8 years ago by irialcon

We still see a memory leak (albeit slower growth)

  • even after integrating all the changes suggested on the forums to date

So it is not possibe for us to avoid this issue and if this issue is unfixed, this may block the release of our product.

Is this ticket currently being investigated ?

comment:4 Changed 8 years ago by evan

Milestone: tbd1.6
Owner: changed from Bryan Forbes to evan

We'll try to get it fixed for 1.6

comment:5 Changed 8 years ago by irialcon

Please post any test-fixes so that we can test/apply them and hopefully unblock the release of our product

Changed 8 years ago by evan

Attachment: datagrid-#12037.patch added

Fix from Oliver(IBM, CCLA), the patch fixes the major leaks(dom node), however there's still a very slow leak when running for a long time. Still need a further look.

comment:6 Changed 8 years ago by evan

Cc: xwzhu@… added

Changed 8 years ago by evan

Attachment: memoryLeakTest_evan.html added

Made some trivial changes to the test case and the average memory usage is stable in FF3.5/3.6. The test case is changed by strictly following http://docs.dojocampus.org/dojo/data/ItemFileReadStore#reloading-refreshing-itemfilereadstore-from-a-data-object-dojo-toolkit-1-4 for resetting datastore

comment:7 Changed 8 years ago by evan

Resolution: fixed
Status: newclosed

(In [23534]) Fixes #12037.
By disconnecting events each time restore() invoked:

  1. DataGrid??._setStore()
  2. _FocusManager._initColumnHeaders()
Note: See TracTickets for help on using tickets.