Hello Scott
It seems your statement is not correct in general. First of all, garbage
collection for UI part (Javascript) is provided by Web Browser, and it is
highly depends on web browser internal implementation.

We've spend more then 2 weeks for internal testing, and have following
results
The worse case in Internet Explorer 6 and 7. The problem is that IE uses not
mark-and-sweep algorithm, but the count references to the objects so in case
of cyclic references A->B->A IE does not release memory. See hyperlink
provided by Bob Stachel  few posts before.
Things goes better in FireFox (we test on 3.x).
The best one is Google Chrome (unfortunately our customer refuse it, he
prefers IE).

Except this you should pay attention to native functions, DOM manipulation,
event listeners especially when you set your listener to objects like
Window, and not release them when widget detached (in our case we found few
place when this problem occurs, after code inspection).
Ex:

   /**
     * Initialize the handlers.
     */
    private void initHandlers() {
        Window.addWindowResizeListener(new WindowResizeListener() {
            public void onWindowResized(int x, int y) {
                recalculateHeaderWidth();
            }
        });
    }

In this case outer class will be never released since Window class will have
reference to it's inner class, and inner class reference to outer class.



2009/1/17 Adligo <[email protected]>

>
> Hi All,
>
>   I have been writing GWT assuming that it did garbage collection
> similar to the way that java does, or in other words it looks for
> Objects (chunks of memory) which don't have any active references
> pointing to them and removes those from the heap via the garbage
> collector.   Is this general assumption correct?
>
>
> Cheers,
> Scott
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" 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/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to