views:

1627

answers:

4

The UI for an application I work on was recently redone with Ext.js and I have noticed the memory usage of IE seems very large when viewing it. Are there known memory issues with Ext.js when using IE?

A: 

As far as I'm concerned, I haven't heard of notable memory leaks in ExtJS. Though I'm sure there have been some, they usually get fixed pretty fast, and the community is so big that most bugs are known.

Make sure your design is based on individual components that you can add and remove when they are no longer needed since most of the time, an ExtJS webpage will only be loaded once and the mem gets filled with the additional components you give it. You can free up some mem using Ext.destroy(this.el) once you have finished using a component.

Also, make sure you use Firebug to track down any component or object that should have been removed.

m_oLogin
+6  A: 

The first thing that jumps out at me in your question is that you are seeing this in IE. My team recently went through the same issue (Extjs on IE). It turns out Ext is not the culprit but rather IE is likely the cause.

A quick Google for 'IE closure memory leak' will find you plenty of explanations, but the basic gist is as follows:

IE uses two separate engines to manage the DOM and JavaScript. When JavaScript makes a call to create a DOM element, the Javascript engine reaches across to the other to create it. If you attach JavaScript to an event on a DOM element, a link is created back from the DOM side to JavaScript side.

The problem lies in the fact that each engine has its own garbage collection and can't see across to the other engine. So circular references are REALLY easy to come across that can eat of large quantities of memory very quickly.

Mike Clark
A: 

I think that it's quite easy to create memory leaks when programming with ExtJS for non-experienced programmers. This is not ExtJS problem on itself. It's ExtJS programming paradigm which lets programmers to easily make such mistakes.

From my experience I've created memory leak when tried to make a straighforward AJAX chat using ExtJS. When some objects are constantly created within AJAX callbacks (such as datastores, grid manipulations), then these objects are not released and destroyed. There must be special and very clever techniques used to avoid memory leaks with ExtJS, and it's not only related to AJAX or callbacks.

All in all, ExtJS is great library, but it must be used carefully.

Thevs
There is an autoDestroy property for stores that can help with this.
geographika
A: 

Check out this thread in their forums which covers a lot of leaks in Ext 2.2 caused by orphaned elements. It seems that Ext 2.2.1 fixed most of them.

The issue is still Open, btw. ;)

Jabe