Hey,
A similar problem exists with IFrames, I started a discussion and
filed a bug report for that issue.
The cause seems to be the same:
When IE does removeChild, the child is removed from the DOM tree, but
it is not cleared.
The trick is to set the src to javascript:'' which forces the hosted
page to unload. After that I use outerHTML to really clear the
element.
For a bit more reading on this subject see:
http://code.google.com/p/google-web-toolkit/issues/detail?id=1821
Although I reported this problem, the Google engineer or contributor
that looked at the bug simply change the state to NotPlanned, while it
is clear that he did not understand that I was actually giving him the
solution. There is also a discusion in the GWT contributor group about
this. Maybe we should join forces in pointing out that this is a major
showstopped for big applications.
This is the thread by the way
http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_thread/thread/fc0fe19dea871f36/b19f4184050d0f83#b19f4184050d0f83
David
> I'll try to remove the 3rd party libs to see if this makes any
> difference.
> @Rainer: I'm still confused: If my application runs fine on Firefox
> (withoutmemoryleakage) it should run fine on IE as well or am I
> wrong? If thememoryleak is still there after removing 3rd party libs
> I would consider this a gwt bug. Agreed?
>
> On 21 Nov., 19:06, Luca Masini <
luca.mas...@gmail.com> wrote:
>
>
>
> > Well, you say that GWT should take care of this, but is nearly
> > impossible.
> > Also thinking at the various leakege that has IE with many patterns
> > make this really difficult to Google's guys.
> > But my test case is very FLAT, few lines of code and not much more, so
> > I think that should be at near-zeromemoryfootprint.
> > How can we think to developmemorysavy applications if also the
> > fundamentals are not themsefmemorysavy ?
> > > > > > We have noticed the IEmemoryprob a couple of weeks ago... Since that
> > > > > > we are praying
> > > > > > to Padre Pio hoping for the miracle BEFORE 31/12: our final release
> > > > > > date!
>
> > > > > > crossing fingers
> > > > > > Giovanni
>
> > > > > > On Nov 19, 10:30 am, Luca Masini <
luca.mas...@gmail.com> wrote:
>
> > > > > > > GWT claim (and I think DOES) that he can transparently handle such
> > > > > > > things.
> > > > > > > When I add a Widget to a panel and then I remove it the onAttach and
> > > > > > > onDetach events handle all the internals !!!
> > > > > > > So the circular reference IS NOT THE PROBLEM !!!!
> > > > > > > Nulling references is important when you want the JavaScript side to
> > > > > > > be disposed, or you will have a reference from ROOT and mark and sweep
> > > > > > > GC will not start !!!
>
> > > > > > > The problem is somewhere else, but I don't know where it is.....
>
> > > > > > > I'm starting to think that it's impossibile to use Internet Explorer
> > > > > > > for serious AJAX application !!!
>
> > > > > > > On 19 Nov, 00:33, "Milan Jaric" <
milan.ja...@gmail.com> wrote:
>
> > > > > > > > Even inerrHTML does not removes them frommemory.
> > > > > > > > Last time I haven't give you full answer of problem you have.
>
> > > > > > > > problem is with REFERENCES in javascript , and problem sounds like
> > > > > this.
>
> > > > > > > > WHEN EVER YOU MAKE A REFERENCE TO AN OBJECT, THEN MAKE ANOTHER, AND
> > > > > THEN TRY
> > > > > > > > TO DISPOSE OBJECT FROMMEMORYBY MAKEING REFERENCE2 = NULL; YOU
> > > > > DIDN'T
> > > > > > > > REMOVE OBJECT FROMMEMORY, YOU HAVE REMOVE REFERENCE TO THAT OBJECT.
> > > > > *WHEN
> > > > > > > > ALL REFERENCES ARE REMOVED FROM OBJECT THEN AND ONLY THEN JAVASCRIPT
> > > > > GC WILL
> > > > > > > > REMOVE OBJECT FROMMEMORY*
>
> > > > > > > > my point is, when GWT loads widget it makes reference to that object
> > > > > and
> > > > > > > > then puts it in some dom element. The first is variable
> > > > > > > > *TextBox textBox = new TextBox(); *and second is
> > > > > > > > *RootPanel.get("slot1").add(textBox);
> > > > > > > > *when you remove textBox from slot1 like this :
> > > > > > > > *textBox.getParent().remove(textBox); *you didn't remove textBox
> > > > > from
> > > > > > > >memoryjust from slot1 ( javascript : slot1.removeChild(textBox); )
> > > > > > > > seams to me grand child has left inmemory, what a hell is going
> > > > > > > > > However, if one version leaksmemoryand the other doesn't, even
> > > > > if
> > > > > > > > > it's clearly a browser bug, let me just answer the obvious for
> > > > > you:
>
> > > > > > > > > In that case, innerHTML is better. Duh!
>
> > > > > > > > > On Nov 17, 11:48 pm, Luca Masini <
luca.mas...@gmail.com> wrote:
> > > > > > > > > > I'm not a JavaScript expert, but they have the same visual
> > > > > effect and
> > > > > > > > > > also innerHTML = '' doesn't leakmemory, instead removeChild
> > > > > does !!!!
>
> > > > > > > > > > What do you think it's better ?
>
> > > > > > > > > > On 17 Nov, 05:20, WongTseng <
wangzengveryc...@gmail.com> wrote:
>
> > > > > > > > > > > can you elaborate on the difference between innerHTML="" and
> > > > > > > > > > > removeChild. which way is better?
>
> > > > > > > > > > > 2007/11/17, Milan Jaric <
milan.ja...@gmail.com>:
>
> > > > > > > > > > > > garbageBin.innerHTML = ''; is not same as
> > > > > garbageBin.removeChild
> > > > > > > > > > > > (childElement);
> > > > > > > > > > > > when you call innerHTML = something or nothing, garbageBins
> > > > > childs
> > > > > > > > > or none
> > > > > > > > > > > > is interpreted again (all of them even garbageBin it self
> > > > > ) it
>
> ...
>
> read more >>- Hide quoted text -
>
> - Show quoted text -