Layouts leak memory (captions, spacers)

I’m writing this in the hope to get a response from Vaadin developers or seasoned users. I recently found that my major performance problems come from memory leaks in the client side engine of Vaadin. I filed
a bug report
, but I don’t believe anyone is going to look at it and take the time of running the Maven command line to -at the very least- confirm the bug, and was not able to provide a patch so far.

To fix the leak on my side, I had to replace all calls to Layout.setSpacing(true) with equivalent CSS rules, which in some cases was truly not easy at all.

Now I discovered that .v-caption are leaked, too. I didn’t package a test case (since it seems nobody run the previous one), but it happens when a Window containing a VerticalLayout with TextField’s (with non empty captions, of course) is removed from its UI. Apparently this leak causes smaller performance drops than the other one, even after thousands of elements are leaked - but still these elements are kept from LayoutManager and waste CPU cycles. To solve this issue I’d have to switch to CssLayout everywhere (CssLayout doesn’t leak captions), and this is not feasible at this stage of development.

I wonder how you deal with these critical issues, becuase I don’t think I’m the only one building Vaadin GUIs with Vaadin layouts instead of using plain DIV’s (CssLayout). From Vaadin developers, I’d like to know if these problems are known, and if yes when they will be addressed.

Cheers,
Raffaele

Thank you for this report and the associated ticket. I don’t think we’ve encountered - or heard someone else encounter - this kind of an issue before, but we will certainly take a good look at it. It is unfortunate that right now we (the core developers) are a bit swamped with getting 7.2 ready on one hand and fixing bugs prioritized by our pro account customers on the other hand, so “regular” bug reports may pass under the radar or have longish response times. This is hopefully something that improves as the size of the core team grows, and we may be able to dedicate someone to respond to all tickets.

A tip about test cases: often the best test case from our point of view is a single UI class, not a complete project. The Vaadin dev environment includes an embedded Jetty and a test runner servlet where you can just drop a UI to run it, so it is a path of even less resistance than a maven project. Also, it allows one to take a look at the code in trac without downloading and opening a zip file.

Johannes