Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disappearing insights on dashboards due to canvas context loss #28379

Open
thmsobrmlr opened this issue Feb 6, 2025 · 0 comments
Open

Disappearing insights on dashboards due to canvas context loss #28379

thmsobrmlr opened this issue Feb 6, 2025 · 0 comments
Labels
performance Has to do with performance. For PRs, runs the clickhouse query performance suite

Comments

@thmsobrmlr
Copy link
Contributor

In what situation are you experiencing subpar performance?

We have a customer where insights on a dashboard disappear with the "sad face" icon on the canvas element, after they initially load fine. This is likely due to running out of available memory.

Instrumentation reveals that we have a couple of other people who might be running into the same issue. Since context loss can also appear when devices go into sleep mode etc., we can't know for sure if they are indeed having the issue or if a context can be restored subsequently.

How to reproduce

Unfortunately I can't reproduce this on my end. The relevant dashboards load fine & quickly on my M1 Mac. I wasn't able to build enough memory pressure by opening a lot of tabs with Chrome's memory saver disabled.

Additional context

There is a known issue with canvas elements, as they can't release memory when unused (like other memory hungry elements do) - see https://wiki.whatwg.org/wiki/Canvas_Context_Loss_and_Restoration. The proposed workarounds could be a potential solution:

Web apps can track events to detect when the page is no longer visible (http://www.w3.org/TR/page-visibility/) and deallocate backing stores at that time by setting the size of the canvas element to 0. Conversely, they can detect when the page is visible again and reinitialize at that time
Web apps can track events that are often associated with GPU context losses (e.g. waking-up from hibernation), and conservatively reinitialize the 2D canvas by resetting the context (set canvas width/height) and redrawing, just in case.

@thmsobrmlr thmsobrmlr added the performance Has to do with performance. For PRs, runs the clickhouse query performance suite label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Has to do with performance. For PRs, runs the clickhouse query performance suite
Projects
None yet
Development

No branches or pull requests

1 participant