Vaadin 7.x.x How to Cleaning up resources in a one UI from server side and

How to Cleaning up resources in a one UI from server side and close him?

Typically, you’d do cleaning up in a UI DetachListener. See https://vaadin.com/docs/v7/framework/application/application-lifecycle.html for some more details.

-Olli

Olli Tietäväinen:
Typically, you’d do cleaning up in a UI DetachListener. See https://vaadin.com/docs/v7/framework/application/application-lifecycle.html for some more details.

-Olli

What is written in the documentation has already tried, GC does not collect UI objects and their resources

Note that UIs are not destroyed immediately after the browser window closes:

UI is kept alive for as long as requests or heartbeats are received from it. It expires if three consecutive heartbeats are missed.

If the UI is not garbage collected in the GC pass after three missed heartbeats, you have a reference to the UI object somewhere that needs to be freed.

-Olli

Olli Tietäväinen:
Note that UIs are not destroyed immediately after the browser window closes:

UI is kept alive for as long as requests or heartbeats are received from it. It expires if three consecutive heartbeats are missed.

If the UI is not garbage collected in the GC pass after three missed heartbeats, you have a reference to the UI object somewhere that needs to be freed.

-Olli

Any links to the object UI, I did not find …
HB exhibited and defaults and hand at 60 (minute) … objects hang until the whole session collapses

If the session is destroyed, you should be able to act in a SessionDestroyListener, at least, then.

-Olli

Do you use CDI add-on?

Tatu Lund:
Do you use CDI add-on?

no

Olli Tietäväinen:
If the session is destroyed, you should be able to act in a SessionDestroyListener, at least, then.

-Olli

I do not need to destroy the session … but only UI

If the UI’s left hanging there, there must be something in your application code, that has references to them, which prevents them to get GC’d. The most typical such error is, that there is e.g. runaway background thread that has not been stopped and cleaned up, and it contains application logic with references to UI’s. Vaadin does not clean up threads, that you need to do yourself, e.g. in above mentioned SessionDestroyListener or UI.detacht(), … I asked about CDI add-on, because older version of it had known bug of memory leakage with UI’s, but that is fixed in version 1.0.5.

Tatu Lund:
If the UI’s left hanging there, there must be something in your application code, that has references to them, which prevents them to get GC’d. The most typical such error is, that there is e.g. runaway background thread that has not been stopped and cleaned up, and it contains application logic with references to UI’s. Vaadin does not clean up threads, that you need to do yourself, e.g. in above mentioned SessionDestroyListener or UI.detacht(), … I asked about CDI add-on, because older version of it had known bug of memory leakage with UI’s, but that is fixed in version 1.0.5.

Auxiliary threads are smothered as is like … and even without their initialization … still UI hangs