Vaadin Dialog overlay retention causing client‑side memory growth
0 reputation · 20 Jun 2024, 14:47 UTC
0 reputation · 20 Jun 2024, 14:47 UTC
Vaadin Dialog overlays are expected to be fully disposed after the dialog is closed, yet repeated open/close cycles can cause client‑side memory growth.
The goal is to verify whether the overlay component retains a reference to the dialog after closure, which may lead to a memory leak in Chrome DevTools heap snapshots. Testing must be performed on a supported Vaadin version (e.g., 14) using Chrome DevTools, and results may differ on newer releases or other browsers. Does the overlay retain a reference to the dialog after close in Vaadin 14? Is the memory growth reproducible when opening and closing the dialog multiple times?
Under normal Vaadin 14 cleanup, the Dialog overlay is designed to be detached from the DOM and have its internal event listeners removed when close() completes. A lasting overlay-to-dialog reference is therefore not expected after closure. However, this is not a blanket guarantee that every application-owned object becomes unreachable.
Repeated open/close cycles can show retained-memory growth in Chrome, particularly when custom content installs listeners or closures, or when the dialog remains attached or reachable elsewhere. The symptom alone does not establish a Vaadin leak, and reproducibility must be measured in the affected release and browser.
close() ends the overlay interaction; it does not promise to dispose arbitrary custom components or remove application-installed listeners.vaadin-dialog entry remaining in a heap snapshot is not proof of a leak. The relevant evidence is increasing retained size plus a retainer path showing that the closed overlay or dialog remains reachable.Dialog dialog = new Dialog();
dialog.setContent(new Span("probe"));
Button run = new Button("Run", event -> {
for (int i = 0; i < 20; i++) {
dialog.open();
dialog.close();
}
});
The one diagnostic detail that changes the recommendation is whether the reproduction contains only plain Label or Span content, or custom components and client-side listeners.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.