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

Give user feedback on large matrix downloads and the possibility of crashing the browser #502

Open
bmbroom opened this issue Jun 13, 2023 · 0 comments
Assignees

Comments

@bmbroom
Copy link
Member

bmbroom commented Jun 13, 2023

Downloading data from very large NG-CHMs as TSV data can crash the browser is ways that we can't detect or prevent.

Warn the user about this if they attempt to download a large data matrix.

@bmbroom bmbroom self-assigned this Jun 13, 2023
bmbroom added a commit that referenced this issue Jun 13, 2023
The browser can fail with an out-of-memory error when trying to download a
very large data matrix (in my tests hundreds of gigabytes worth).

This patch uses several strategies to increase the download size at which
that happens:

- Gets access windows one row at a time and only for the range of
  requested columns. This minimizes tile cache memory needed.
- Converts rows to tsv format on the fly, so we don't need to convert
  the entire matrix to tsv format at once.
- Constructs a blob using a vector of the row tsv data.  This is more
  memory efficient than manually building a data URL.

These steps help but don't eliminate the problem.  (I don't think that's
possible purely in browser.)  A future patch will a display warning notice to
the user for very large download sizes.
bmbroom added a commit that referenced this issue Jun 13, 2023
If the number of array elements to download exceeds a threshold (currently
one million array elements) show a warning to the user that the download
may kill the browser due to memory exhaustion.

If the user chooses to proceed, a progress bar is displayed.

If the warning dialog is displayed, the user can cancel the download.

For large downloads there is a noticeable delay between when we have
finished all processing (and hide the dialog) and when the browser is
ready to save the file.  The browser can still crash during this time.
I'm not sure if there's anything that we can do about that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant