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

webassembly-memory-error on Chrome (with test case) #301

Closed
gabor opened this issue Jun 20, 2019 · 4 comments
Closed

webassembly-memory-error on Chrome (with test case) #301

gabor opened this issue Jun 20, 2019 · 4 comments

Comments

@gabor
Copy link

gabor commented Jun 20, 2019

try the attached test-case ( jsmpeg-error-repo.zip )

  1. unzip it

  2. serve the directory with a webserver, for example with python3 -m http.server --bind localhost 4444

  3. open http://localhost:4444 in Google Chrome

  4. click the [restart] button

the script will now start the playback of a video file, and after 1 second it destroys the jsmpeg-instance, and starts again.
on my computer, after around 100 iterations you get an error-message

Uncaught RangeError: WebAssembly.Memory(): could not allocate memory
    at WASM.loadFromBuffer

it seems to work ok on Firefox.

the included jsmpeg.min.js is named based on the git-commit i took it from.

@dhlavaty
Copy link

This is exactly bug, that happens in our app. We have a single page application, and jsmpeg crashes after several clicks with this error.

@calvinwyoung
Copy link

I get the exact same error in my SPA. Unfortunately it looks like reloading the page doesn't immediately free memory. Is there a way to explicitly clear the WebAssembly memory buffer?

@phoboslab
Copy link
Owner

There doesn't seem to be a way to explicitly free WASM memory. So the "fix" above just caches the instantiated module indefinitely, instead of re-creating it each time.

@fijackokresimir
Copy link

fijackokresimir commented Jan 24, 2020

@phoboslab
are you sure it's WASM memory?
issue is present even if WASM is disabled - but memory increase is much slower
browser memory dump shows increase in some ArrayBuffer that never get's cleaned

it might be even bug in garbage collection of typed arrays

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

5 participants