Upgraded to gwt 2.0.0 and the Speed Tracer plugin (Windows 7, 64bit,
Chrome), and noticed my app generated an infinite number of timer
timeouts.
I got it down to a hello,world style app. This is the whole app:
public class Test implements EntryPoint {
public void onModuleLoad() {
String token = History.getToken();
RootPanel.get("block").add(new Label("hi"));
}
}
Run this app, and watch the result with the Speed Tracer plugin in
Chrome. I get a constant stream of:
"Event Trace. Timer Fire. Duration 18ms. Time Type: setTimeout.
Interval 250ms"
Remove the History.getToken() and all the timers go away.
Any ideas?
This timer is the only way to detect that the URL's #hash part has
changed (and therefore fire a ValueChangeEvent)
...at least until Chrome implements HTML5's onhashchange (as IE8 does
already, and FF soon will in 3.6). This means that currently all GWT
permutations except user.agent=ie8 use a timer.
It that really annoys you, you can still try to provide your own
HistoryImpl implementation that would not use a timer, for instance
based on this trick http://ajaxian.com/archives/emulating-onhashchange-without-setinterval
;-)
Noticed this old thread and found that the current version of GWT still uses the timer. Is this still necessary for Chrome? Seems to be taking a lot of memory.