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."
Topics: GWT
Comments: 2 so far
Leave a comment
About Pathfinder
Follow the Blog
-
Get a monthly update on best practices for delivering successful software.
Subscribe via email
Subscribe via RSS
Categories
Topics
Archives
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
Blogroll
Recent
- Elements of Testing Style
- Aesthetics and Web Design
- Asterisk-Java Testing with Groovy
- 3 Misuses of Code Comments
- Fluently NHibernate
- Digging a Hole and Covering it with Leaves — The Software Development Version
- The Importance of User Experience - Do You Understand It in Your Bones?
- Writing Your Own Protocol With NSURLProtocol
- What’s In Your Dock: iPhone edition
- Feature Fatigue

Which bugs were marked fixed when they weren’t fixed?
Comment by Ben Fulton, Thursday, December 6, 2007 @ 5:42 am
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