is it memory leak ?


I test my modular osgi vaadin application ( draft ). It’s built 100% from components beginning from servlet.
Playing with VisualVm confused me a bit.
UI window is classic, on the left accordion/tree with menu created from components, right part is TabSheet.
Clicking on menu item creates new closable Tab in TabSheet.

Now the problem. When I close single Tab that’s ok - VisualVm shows me one component less, but when I close browser tab, all components created from menu stay until … I think session timout. There is not problem of closing browser tab, I see “detach” of UI when I close browser tab. Does it mean that UI.close is not realeasing all components ?


the UI cleanup is done on each request - so if you just close the “last” open instance of the UI, it will not be cleaned up until there is another request from any client. As far as I know, this is simply because otherwise there would have to be some kind of background process running which would handle closing the detached UI with no request cycle going on.

So basically, this is a kind of a memory leak, but the UI should be cleaned up as soon as the next request comes in from any client. You should probably anyway have your own detachlistener for your UI which would clean up everything possibly eating lots of memory.