Suppose i have a variable set with a GWT Widget.
this variable is added into a GWT containe => the widget is added to
a parent container.
The question is. If i remove the widget from the parent and set the
variable to null, Does the Js or GWT collector frees in the right way
the resources ?
If it is not the case? What is the best practice ?
Best Regards.
Luciano
--
http://www.gwtwindowmanager.org
Now I'm bothered. A few webpages seem to suggest that (big surprise)
IE leaks with closures. No one has a great solution other than to "be
careful" so I assume that also means set things to null.
On Feb 20, 7:00 am, "Luciano Broussal" <luciano.brous...@gmail.com>
wrote:
It is a precious and important response for me.
Luciano
Regards
Luciano
---
http://www.gwtwindowmanager.org
I just wanted to chime in here with some of my own experience. In the
case of the Mozilla browsers, the problem is that DOM objects are
"garbage collected" by reference counting, rather than a real garbage
collector. As with all reference-counting implementations, this one
breaks when it encounters a cycle. (The Mozilla DOM code may include
some kind of cycle breaking logic--I'm not sure--but if such logic
exists, it doesn't--or didn't--bridge the DOM-Javascript divide.)
The Javascript garbage collector is of the mark-and-sweep variety, I
think, so it will handle cycles, but, as Dan pointed out, when the
Javascript engine and the DOM interact, the solution is to punt. This
usually rears its head when you have an event listener that closes
over the DOM node that it's attached to because you end up with a
Javascript object (the listener) that references a DOM node (the
listened-to) which refers back to the Javascript object (the
listener).
You can look at this Mozilla bug for some more detail:
https://bugzilla.mozilla.org/show_bug.cgi?id=241518
Ian
--
Tired of pop-ups, security holes, and spyware?
Try Firefox: http://www.getfirefox.com