vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
618 stars 167 forks source link

Improvement: Memory management #8399

Open netbeansuser2019 opened 4 years ago

netbeansuser2019 commented 4 years ago

Ref vaadin/platform#1351

Regardless to if it is implemented com.vaadin.flow.router.BeforeLeaveObserver it should be released "route component" and even layout with respecting to com.vaadin.flow.router.PreserveOnRefresh.

So shorting period to be marked as inactive so javascript event unload -> shorting activity period on server for that instance -> nothing comes then release earlier like detach and release to be possible cleared by garbage collector.

and if implements com.vaadin.flow.router.BeforeLeaveObserver call beforeLeave(...) where (event.isUnloadBrowserEvent() && !event.isFromClient()) this is true.

netbeansuser2019 commented 4 years ago

So without that e.g. any opening pages from internet-browser-bookmarks cannot signal leaving of page can lead to xy not needed instances in memory that could be even heavy.

juhopiirainen commented 4 years ago

Thank you @netbeansuser2019 for the ticket. I move this to the Flow team for investigations.

netbeansuser2019 commented 4 years ago

See also #8400