I am trying to identify the source of a memory leak in a Vaadin 7 CDI application. The eclipse memory analyzer has revealed that the appliation’s UIs are never cleaned up, although they have long been
detached (days earlier according to the log files).
When looking at the GCRoot, it is always the “org.apache.deltaspike.core.util.context.ContextualInstanceInfo” that holds the reference.
Has anyone any idea what could prevent the release of the UI scope?
Michael, thanks for your help. That was interesting, but my issue was a little different since the CDI UI and the last active CDI View were never cleaned up, even after session expiry.
The cause was a very simple mistake. But since others might also stumble into it, I want to share it:
At some point in the project, somebody introduced a custom servlet in order to add a BootstrapListener and configured it in the web.xml.
Unfortunately, this custom servlet was not derived from Vaadin
CDI Servlet (which is used by default with CDI), but from VaadinServlet which - of course - does not care about cleaning up contextual resources…
A litle warning during startup would however have been very helpful (at least I haven’t seen one)…
It is good to note, in scope of original question, that in CDI add-on v1.0.5 there are fixes both regarding UI scope cleanup and issue regarding @PreDestroy.