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

Fatal JavaScript out of memory on Deno #81

Closed
bavoco opened this issue Oct 20, 2024 · 3 comments
Closed

Fatal JavaScript out of memory on Deno #81

bavoco opened this issue Oct 20, 2024 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@bavoco
Copy link

bavoco commented Oct 20, 2024

Really enjoying using this library, but lately I have trouble running the latest versions (0.0.9, 0.0.10) on Deno (versions 1.45.x, 1.46.x, 2.0.x)

Given:

// @deno-types="https://cdn.jsdelivr.net/npm/wasm-vips/lib/vips.d.ts"
import Vips from 'https://cdn.jsdelivr.net/npm/wasm-vips/lib/vips-es6.js';

const vips = await Vips({
    dynamicLibraries: [],
});

The output is:

error: Uncaught (in worker "em-pthread")(in promise) RangeError: WebAssembly.Memory(): could not allocate memory
    at https://cdn.jsdelivr.net/npm/wasm-vips/lib/vips-es6.js:15:84
    at https://cdn.jsdelivr.net/npm/wasm-vips/lib/vips-es6.js:242:14

#
# Fatal JavaScript out of memory:...

Things I've tried:

  • reducing the INITIAL_MEMORY:
const vips = await Vips({
    dynamicLibraries: [],
    INITIAL_MEMORY: 512 * 1024 * 128,
});
  • adding --v8-flags=--max-old-space-size=4096

Version 0.0.8 and before are working great.

@kleisauke kleisauke added the bug Something isn't working label Oct 23, 2024
@kleisauke kleisauke added this to the v0.0.11 milestone Oct 23, 2024
kleisauke added a commit that referenced this issue Oct 23, 2024
@kleisauke
Copy link
Owner

I was able to reproduce the issue, and confirm that it only occurs with version 0.0.9 or later.

Commit kleisauke/emscripten@67924ad fixes this, this will be in v0.0.11. Thanks for reporting this!

@kleisauke
Copy link
Owner

Upstream PR: emscripten-core/emscripten#22778.

@kleisauke
Copy link
Owner

kleisauke commented Oct 31, 2024

v0.0.11 is now available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants