Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
ConnectorTracker not releasing syncIdToUnregisteredConnectorIds entries
We are using Vaadin 7.6.6 and I am looking into a memory out issue where the TreeMap syncIdToUnregisteredConnectorIds in ConnectorTracker grows until the system runs out of memory. Here is the scenario.
We have a page that auto-refreshes via a server side thread that monitors the status of a device and updates the UI every 8 seconds. When the refresh of the UI occurs some old widgets are replaced with new ones which triggers some connectors to become unregistered and added to the syncIdToUnregisteredConnectorIds Map. This map continues to grow until a client RPC call comes in and the cleanConcurrentlyRemovedConnectorIds() method is called. From what I can tell the RPC's are triggered by user activity in the UI. In this scenario however the user left their browser open and went home for the weekend. In some configurations of our server we have no session timeout so the syncIdToUnregisteredConnectorIds continues to grow until memory runs out.
I am considering calling the cleanConcurrentlyRemovedConnectorIds() myself as part of the refresh process if I can determine the proper lasSyncIdSeenByClient argument to ensure the syncIdToUnregisteredConnectorIds Map does not grow until memory out.
Are there other ways to handle this problem?
This looks like https://dev.vaadin.com/ticket/19822 which was fixed in the master branch just a couple of days ago. There has not yet been any release containing the fix, but a workaround is known.
By enabling UI polling (i.e. UI.setPollInterval), there will be occasional RPC calls even though the user is inactive. Since the polling is only used for allowing memory to be released, you don't need to have a very tight poll interval. Something like once per hour might be more than enough.