PDA

View Full Version : Component destruction and other extjs memory issues ..



vrkiran
3 Mar 2010, 5:26 PM
Are there any FAQ, documents or examples that discuss how to cleanup components and other objects in the life cycle of a window, form, tab, tree, grid etc? None of the main examples in extjs.com seem to deal with this issue (atleast not that I could find). Over a few hundred reloads during debugging, FF goes to 1G+!!

I am new to extjs and any links will be greatly appreciated.

Thanks
Ravi

Mike Robinson
4 Mar 2010, 8:20 AM
That is pretty-much "FireBug doing its thing." Not so much FireFox.

I can't speak authoritatively on the memory-management of Firefox during normal operation, but I do know that "there's only so much time you can spend debugging" before you need to close and restart Firefox.

Maybe that's a good thing, all in all, because: there's only so much time time you can spend debugging before you need ~o).

Webmasters: "I see the icon for coffee. But where's the icon for strong Scotch whiskey?" >:)

vrkiran
4 Mar 2010, 9:48 AM
That is pretty-much "FireBug doing its thing." Not so much FireFox.

I can't speak authoritatively on the memory-management of Firefox during normal operation, but I do know that "there's only so much time you can spend debugging" before you need to close and restart Firefox.

Maybe that's a good thing, all in all, because: there's only so much time time you can spend debugging before you need ~o).

Webmasters: "I see the icon for coffee. But where's the icon for strong Scotch whiskey?" >:)

Thanks for your response!

May be I did not ask my question very clearly. I am not worried much about memory accumulation during my debugging/testing (firebug is disabled for most part anyway).

I am just worried about the user experience when they use my app. Are they going to accumulate memory as they keep using my app over a couple of hours when they keep opening and closing different forms, tabs, panels, grids? I also use Polling Readers etc., which also worry me because I am not sure what I am supposed to do when I done using them, the documentation has no guidelines on best practices.

In other words, what are the top N things I need to know about cleaning up Extjs components correctly as I am done using them?

Thanks
Ravi

rbastic
4 Mar 2010, 12:20 PM
1. yourComponent.destroy(); // call this whenever done with something
2. yourVariable = null; // properly set all objects to null when done
3. Pray.

That's really the best you can do. The rest is up to the garbage collector and the particular JavaScript interpreter you're running under. (Chrome's definitely got the most advanced and performant, at the moment).