Skip to content

Provide a mechanism to allow attempting a segment of code that could OOM, with the ability to fall back in case it does. #5

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

Open
dead-claudia opened this issue Oct 26, 2021 · 2 comments

Comments

@dead-claudia
Copy link

This would be valuable for very large allocations where you don't want to crash the application or page, but instead display an error or otherwise tolerate such failure.

@erights
Copy link
Collaborator

erights commented Nov 4, 2021

I don't understand the title of this issue. Could you clarify? Thanks.

@dead-claudia
Copy link
Author

Something like this:

try {
	const foo = new Uint8Array(1*1024*1024*1024)
} catch out of memory somehow {
	// display an error or maybe try with a smaller chunk size
}

Stuff like downloading files to decrypt using Web Crypto (which lacks a streaming API and has been dragging their feet for well over a year despite the demand and precedent) and large image/video processing come to mind.

Regarding language precedent, here's a few I found in a few minutes of searching:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants