PDA

View Full Version : Slow memory leak when reloading store through ajax proxy?



cmadison0005
28 Jun 2012, 2:09 PM
Hey guys,
i have several views, containing grid panels, which are launched in the "center" region when a left nav bar button is clicked. Said navigation/rendering between/of the views seems to be working fine. The issue is with memory. Each view has one or more paged grid panels associated with it, and the stores for said grid panels are populated via an ajax proxy.

Here is the issue:
if i navigate between panels 1 and 2 (successfully showing the correctly paged data for grid panel 1 and 2 respectively) my memory allocation increases with each nav. I have tried explicitly calling removeAll from the store when its respective grid panel is destroyed, but this has little effect on the issue.

This memory leak eventually causes the application to become non responsive regardless of browser. (IE7/8/9, FF 13.0.1). Are there special garbage cleanup measures i need to be taking in terms of the stores since i am potentially reloading/refreshing/modifying the data numerous times?

skirtle
28 Jun 2012, 4:22 PM
Sounds nasty.

Which ExtJS version are you using?

Are you able to produce a simple test case that demonstrates this problem?

Most memory leaks are caused by incorrect library usage but from your description it appears like what you're doing should be fine. One experiment you could maybe try is to have the store without the grid attached. That would allow you to isolate whether the leak is in the store or in the grid.

cmadison0005
29 Jun 2012, 3:59 AM
Sounds nasty.

Which ExtJS version are you using?



Thanks for the reply.

I am using 4.0.7.

Does the MVC framework require that i do a certain level of memory management myself? You mentioned this may be the result of abusing the library... could you elaborate on this?

skirtle
30 Jun 2012, 4:06 AM
I can't think of any obvious reason why using the MVC would have a significant impact on how to manage memory.

The most common mistake in this area is to create components but not destroy them. You can check that quite easily. Run the following in the console:


Ext.ComponentManager.getCount()

Now do some stuff in your app and then check the count again. Repeat the process a number of times, you can get misleading results if you just do it once. If the count keeps creeping up for no apparent reason then you have a component leak. You can find out which components are leaking by taking a look inside the ComponentManager.

There are other managers you can try this with but they're less likely to yield results. e.g.:


Ext.StoreManager.getCount()