Agile Ajax

GWT Conference: Creating Widgets (or really, why GWT won’t leak memory)

This talk by Joel Webber was perhaps the most interesting of the conference so far. It wasn't really about creating widgets, but more about some of the internals of GWT and how it is realized in DOM/JavaScript. For example, why is there this big, ugly DOM class? Apparently in the early days of GWT (before it was know as GWT) all of the DOM object were wrapped in another JavaScript object. So you could write things like element.setStyleName("Woot");. But it ran like a dog. With GWT 1.5, however, the compiler has improved so it can inline calls to DOM, so now Element can have methods that delegate to DOM and the compiler will make sure it runs fast.

Another point was that GWT makes sure that dynamically added DOM nodes don't leak, and unlike most other libraries, they don't do so by cleaning up stuff on unload. I'll see if I can get some sort of version of Joel's talk, because it speaks to some of how GWT is a parsimonious (stingy with  memory and other resources).

Some Joel quotes:

"Why on earth do I have this huge, ugly mega static Class called DOM? That's a fair question."

"Memory leaks in JavaScript are very very subtle. Most JavaScript libraries don't try to solve this problem. GWT does."

"IE7 doesn't fix any of the memory leak problems. They released some fixes and marked the bug fixed, but it's still not fixed."

"IE8 won't fix the memory problem either, since the rendering engine is built on COM and they're not going to reengineer that any time soon."

"If you use GWT and obey the rules for using it, you will not leak memory."

Technorati Tags: ,

Topics:

Comments: 2 so far

  1. Which bugs were marked fixed when they weren’t fixed?

    Comment by Ben Fulton, Thursday, December 6, 2007 @ 5:42 am

  2. How GWT has solved this memory leak problem? There is no mention in the article

    Comment by Antonio, Thursday, September 25, 2008 @ 7:45 am

Leave a comment

Powered by WP Hashcash

About Pathfinder

  • We design and build extraordinary applications for companies looking to make the next great idea a reality.
  • learn more

Topics

WordPress

Comments about this site: info@pathf.com