forceSync() memory leak.

I have been working on a Vaadin web application and seem to have discovered a memory leak involving the vaadin.forceSync() method.

The following line is where the leak is contained, changing the content of the function to be an empty body fixes the leak.

getMainWindow().executeJavaScript(“clearInterval(refresh);refresh = setInterval(function(){vaadin.forceSync();},”+ InterfaceThread.REFRESH_INTERVAL + “)”);

Chrome seems to handle the leak pretty well, Mem Usage rises to around 50k and then seems to be hacked down by a few k and the cycle repeats.

IE8 struggles the most, once the Http session is invalidated because of a login time out, IE grabs another ~3.8k of memory every N milliseconds, where N is the REFRESH_INTERVAL, this does not stop growing, I’ve had it using over 1800k Memory.

Firefox has a simlar leak to IE, when timed out it starts leaking, though it is not as big as the IE leak.

I thought I’d post here rather than raise a defect just incase there is something we should be doing that we aren’t, however it does seem like a leak to me.

If I understood correctly, you are using that JavaScript snippet as a poller to reflect changes from server to client. A better polling solution would be use the
component or the