Conversation
Scheduled invocations are held in memory until they are written into a response, so an application that keeps scheduling ones that never reach the browser runs out of memory. Flow now warns about it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mcollovati
requested changes
Sep 21, 2026
| Where only the latest value matters -- a progress value, a clock, a live measurement -- avoid scheduling a new invocation for every update: | ||
|
|
||
| - Keep the [classname]`PendingJavaScriptResult` that [methodname]`executeJs()` returns, and call [methodname]`cancelExecution()` on it before scheduling the next one. | ||
| - Set an element property with [methodname]`Element.setProperty()` instead. Only the last value of a property is sent. |
Contributor
There was a problem hiding this comment.
It seems not clear to me how element properties are related to pending JavaScript invocation. Do we have documentation that suggests setting properties via JavaScript?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents vaadin/flow#25252
memory leak · flow/component-internals, flow/production ·
applications that schedule
executeJs()from background threads or forcomponents that are not on screen
JavaScript scheduled on the server is held in memory until it's written
into a response for the browser, so an application that keeps
scheduling invocations which never reach the browser runs out of
memory. Flow now logs a warning once 1000 of them are waiting for one
UI. Nothing in the docs described the retention, the warning, or the
alternatives, and the symptom is hard to recognize from a heap dump.
Risks:
✅ Docs only. One new section and one troubleshooting entry, no
moved anchors.
Added an "Undelivered Invocations" section to Calling JavaScript from
the Server, with the anchor
undelivered-invocations.Listed the three cases where invocations pile up: a detached owner,
an invisible owner, and a UI with no open push connection.
Listed the alternatives for values where only the latest one matters:
cancelExecution()on the returnedPendingJavaScriptResult,Element.setProperty(), andUI.getLastUpdateSentTimestamp()tostop scheduling while the browser isn't receiving.
Added an entry to Common Issues on the production troubleshooting
page, pointing at the new section.
🤖 Generated with Claude Code