Appreciate any further suggestions for cleaning up memory usage. The
additional of Disposable roughly parallels the same use in
JSCompiler's Closure Library. In theory. V8's GC should be good enough
to clean up everything if you just blow away the <script> tag and
<iframe> and remove the DOM elements, in reality, it leaks like a
sieve.

-Ray

On Thu, Sep 13, 2012 at 6:27 PM,  <cromwell...@google.com> wrote:
> Reviewers: skybrian,
>
> Description:
> Add experimental GWT.unloadModule() function.
>
> Enable via <set-property name="gwt.unloadEnabled" value="true"/>
> Invoke via window.__gwt_activeModules[moduleName].unloadModule().
>
> Attempts to do the following:
> 1) Cleanup all outstanding non-primitive properties from $wnd
> 2) Remove all registered event listeners
> 3) detach all widgets from rootpanel
> 4) Cancel any continuously running timers, I/Os in progress, etc
> 5) Delete all code from the iframe scope (window != $wnd)
> 6) erase registration from __gwt_activeModules and null out nocache.js
> module function
> 7) Remove iframe hosting the module (if present)
>
> Even with all of this cleanup, Chrome's heap profiler still shows leaks
> on the simplest modules. This is a work in progress to support
> portal-like services that want to load/unload many GWT modules within a
> long running page.
>
> Currently, IE paths which use attachEvent() have not been patched.
>
> By default, support is disabled and there should only be a negligible
> impact on codesize.
>
>
> Please review this at http://gwt-code-reviews.appspot.com/1827804/
>
> Affected files:
>   M user/src/com/google/gwt/core/Core.gwt.xml
>   M user/src/com/google/gwt/core/client/GWT.java
>   A user/src/com/google/gwt/core/client/impl/Disposable.java
>   M user/src/com/google/gwt/core/client/impl/Impl.java
>   M user/src/com/google/gwt/core/client/impl/SchedulerImpl.java
>   A user/src/com/google/gwt/core/client/impl/UnloadSupport.java
>   A user/src/com/google/gwt/core/client/impl/UnloadSupportEnabled.java
>   M user/src/com/google/gwt/geolocation/client/Geolocation.java
>   M user/src/com/google/gwt/storage/client/StorageImpl.java
>   M
> user/src/com/google/gwt/user/cellview/client/CellBasedWidgetImplStandard.java
>   M user/src/com/google/gwt/user/client/History.java
>   M user/src/com/google/gwt/user/client/Timer.java
>   M user/src/com/google/gwt/user/client/Window.java
>   M user/src/com/google/gwt/user/client/impl/DOMImpl.java
>   M user/src/com/google/gwt/user/client/impl/DOMImplMozilla.java
>   M user/src/com/google/gwt/user/client/impl/DOMImplStandard.java
>   M user/src/com/google/gwt/user/client/impl/DOMImplTrident.java
>   M user/src/com/google/gwt/user/client/impl/HistoryImpl.java
>   M user/src/com/google/gwt/user/client/impl/HistoryImplTimer.java
>   M user/src/com/google/gwt/user/client/impl/WindowImpl.java
>   M user/src/com/google/gwt/user/client/ui/PotentialElement.java
>   M user/src/com/google/gwt/user/client/ui/RootPanel.java
>   M user/src/com/google/gwt/user/client/ui/impl/FocusImplStandard.java
>   M user/src/com/google/gwt/xhr/client/XMLHttpRequest.java
>
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to