Anti-pattern example of session abuse


I’m totally new to Vaadin and I’ve been looking by myself for a while for a realistic example of web session bloat when using Vaadin, but it seems that the framework design makes it quite hard to do something stupid. Does anyone know a typical anti-pattern example of web session memory abuse in a Vaadin application?




This should cause some issues if you have lots of users :

List<BookEntity> list = service.loadAllMillionEntitiesFromDB();
BeanItemContainer inMemoryContainer = new BeanItemContainer(list);

If you you sane amount of data in visible components or use lazy loading containers, you should do fine.


Some Spring hints:

  • Session scope your UI is not a good idea with Vaadin 7 (should be prototype scope or custom UI scope)
  • If you have to create Components with Spring, use prototype scope for them as well

A typical case where memory leaks occur: create your own static event router and register your views to it. If you don’t deregister or use weak references, that will cause the entire session to remain in memory after the session should close.

Thanks a lot for these examples, these are really useful!