Vaadin 14 - Memory leak ?


I’m on vaadin 14.0.2.
I simplified my app at its maximum :

public class MainLayout extends Div {
    public MainLayout() {

Each time i refresh my browser page a new com.vaadin.flow.component.UI and a new MainLayout are created. Ok cause I don’t have @PreserveOnRefresh.
But old instances stay in memory. Only me with this problem ?

Obejcts referencing one UI:

com.vaadin.flow.component.PushConfigurationImpl@0xc1814288 (32 bytes) : field ui
com.vaadin.flow.internal.nodefeature.ComponentMapping@0xc1814080 (32 bytes) : field component (32 bytes) : field ui
com.vaadin.flow.component.internal.UIInternals@0xc1813c30 (192 bytes) : field ui
java.util.HashMap$Node@0xc18142a0 (44 bytes) : field value
com.vaadin.flow.router.Router$$Lambda$68@0xc1814270 (32 bytes) : field arg$2 (40 bytes) : field ui


There is an another discussion about it here:

The same problem is behind this issue as well:

I’m not sure it’s related.
Other topics is about objects instanciations. My problem is about objects that stay in memory.
I set the param heartbeatInterval to 30 seconds. Sometimes some UI are garbage collected but never all of them…

Or at least not in time… In fact when is deleted an UI exactly? after 1 miss heartbeat ?

Hi Sylvain. UIs are cleaned up after three missed hearbeats and the default interval is 5 minutes. So that makes it 15 minutes of inactivity until the UI is cleaned. All the remaining UIs are cleaned up once the session is expired. Unfortunately there is no API in the browser yet to be able to detect the user closing the browser window/tab reliably, though the beacon API might be now relevant once we drop support for IE11 starting from V15 (

Here is some more details on how the lifecycle of the UI works