question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[CLI] Limit the number of decoded images in memory

See original GitHub issue

I’m trying edit folder with approx 200 images within npx @squoosh/cli --mozjpeg '{"quality":80}' -d . ./*.jpg and get memory error: 1.54MBRangeError: WebAssembly.Memory(): could not allocate memory at /Users/illy/.npm/npx/83877/lib/nodemodules/@squoosh/cli/build/index.js:7:176011 at instantiateEmscriptenWasm (/Users/illy/.npm/npx/83877/lib/nodemodules/@squoosh/cli/build/index.js:7:153532) at Object.dec (/Users/illy/.npm/npx/83877/lib/nodemodules/@squoosh/cli/build/index.js:7:378727) at decodeFile (/Users/illy/.npm/npx/83877/lib/nodemodules/@squoosh/cli/build/index.js:7:520969) at async MessagePort.<anonymous> (/Users/illy/.npm/npx/83877/lib/nodemodules/@squoosh/cli/build/index.js:7:493320) Worker error: Error [RuntimeError]: abort(RangeError: WebAssembly.Memory(): could not allocate memory). Build with -s ASSERTIONS=1 for more info.

Terminal blinking and process never ending.

Thanks

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
RReversercommented, May 13, 2021

CLI should probably limit parallel execution by number of cores. /cc @surma

1reaction
jcao219commented, Jun 27, 2021

Another good option for controlling the amount of concurrrency when dealing with lots of tasks as promises would be https://www.npmjs.com/package/p-map

Read more comments on GitHub >

github_iconTop Results From Across the Web

Runtime options with Memory, CPUs, and GPUs
To check for support, you can use the docker info command. ... Limit the amount of memory your container can use, as described...
Read more >
Docker Container Memory Limits Explained - Thorsten Hans
By default, the container can swap the same amount of assigned memory, which means that the overall hard limit would be around 256m...
Read more >
Quotas and Limit Ranges | OpenShift Container Platform 3.11
A limit range, defined by a LimitRange object, enumerates compute resource constraints in a project at the pod, container, image, image stream, and...
Read more >
iOS images in memory | RY 's Blog
More memory usage when decoding a image ... let maxDimensionInPixels = max(pointSize.width, pointSize.height) * scale
Read more >
Annotated List of Command-line Options - ImageMagick
Use +antialias to disable the addition of antialiasing edge pixels. This will then reduce the number of colors added to an image to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found