UIs didn't close on page reload

I have an app that is created some heavy DB tasks on each connected UI. I was add a service that periodically start all DB tasks. Before starting task is checking that there is parent UI is alive(UI.isClosing()==false). If not then task is removed from service.
Checks: I open app page in browser, i can open it in some browser tabs also, and i press F5 to reload pages. Tasks in service is adding, and always live. If i look at UIs per each Session, i see that all UIs is not closing.
How can i force dead UIs to close as fast as i really close UI?

In simple words i need an fast method of detect dead UIs, for fast remove heavy UI-dependent operations (such as auto-update Grids, for example).

You might want to take a look at https://vaadin.com/directory/component/cleanupservlet-add-on