Hi, Sanj, You don't say why you think that not removing the listeners is not the cause of your problem. If it is because the amount of leakage seems too large as compared to the size of the listener objects, then it might be that non-removal of the listeners is preventing the (probably much larger) observer and/or observed object from being collected by the GC.
If you are using the PropertyChangeListener class from GWT- EXT, then you probably need to remove any listeners explicitly from the object being observed by invoking removePropertyChangeListener () on each observing object listener in the observed object's PropertyChangeSupport (list of listeners to be notified) object before setting all references to the observing object to null. That should break any circular references that may have been set up between your observed and observer objects. Now, you might think that the GC should be able to detect circularity so long as it is within Javascript, and I would agree, but if you are trying to get rid of the observer (but not the observed) object, then the observer object might hang around due to that unwanted reference to its listeners from the observed object, and in that case it would not be the GC's fault. GWT is supposed to deal with the garbage collectors of the various browsers pretty well, but if you are using native Javascript then the Javascript garbage collector cannot detect circularities between native objects and Javascript objects due to its having no view into the native browser code. And since it can't know about these, it will probably just not collect anything in Javascript if there are references between it and a native object, which means that links between the native object and the JS object must be broken before the GC can do its job. GWT is kind of a new beast so far as the use of Javascript for extended computations without a round trip to the server is concerned. I mean, AJAX in general does this, but the complexity of the computations made possible by GWT can easily equal that of a desktop application, and some browsers may still be designed on the assumption that it is OK not to collect some of the garbage some of the time, because of the expected short duration and complexity of the Javascript that runs between refreshes, where everything gets blown away. So, one way to deal with this would be to meet their expectations by making a trip to the server every now and then. Of course, that interrupts interactivity, and would be a disappointing and demoralizing concession to the browser dragons that GWT is supposed to be slaying, so naturally, if you do it, please don't tell anyone :-). I am using GWT-Ext myself in conjunction with some rather large GWT objects, but have not yet gotten to the point of testing my code, so this issue is of concern and interest. I am new to GWT-Ext, and fairly new to GWT in general, and so my suggestions are based more on speculation and on what I have read than on direct experience. If you think that GWT-Ext might be the problem, then "your main recourse is to look at the source." Hope that is not too general to be of assistance. Carl ------ On Jul 20, 12:33 am, SunilBansal <[email protected]> wrote: > HI All, > > I am facing memory leakage problem in my application. I searched on > Google but i found that memory leakage may be because of EXT JS > because of some cyclic references in between JSNI and DOM objects and > browser is not able to handle these DOM objects for garbage > collection. > > I am using following technologies in my application : - > > GWT 1.6.4 > GWT EXT > Gilead > > When i explorer my code then i found some reason that may be cause of > Memory Leakage as :- > > 1.) While i am clearing the widget or setting it's reference to null > then i am not removing the listeners explicitly. > > But i am feeling, this memory leakage is not only because of this not > removing listener explicitly and now i am not able to understand how > can i remove this problem. > > So, please tell me if anybody have an idea? > > Thanks and regards, > > Sanj --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "GWT-Ext Developer Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/gwt-ext?hl=en -~----------~----~----~----~------~----~------~--~---
