Skip to content

Commit 5f06417

Browse files
unamedkrclaude
andauthored
fix(wasm): OOM on low-memory devices — revert to 256MB + growth (#29)
INITIAL_MEMORY=1GB caused immediate OOM abort on mobile and low-memory devices. Revert to 256MB initial with ALLOW_MEMORY_GROWTH=1. The pthreads+growth warning is a minor perf note, not a crash. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 20615ed commit 5f06417

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

wasm/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ emcc "$SCRIPT_DIR/quant_wasm.c" \
2424
-flto \
2525
-pthread \
2626
-s WASM=1 \
27-
-s INITIAL_MEMORY=1GB \
27+
-s INITIAL_MEMORY=256MB \
2828
-s MAXIMUM_MEMORY=4GB \
29-
-s ALLOW_MEMORY_GROWTH=0 \
29+
-s ALLOW_MEMORY_GROWTH=1 \
3030
-s EXPORTED_FUNCTIONS='["_main","_wasm_load_model","_wasm_generate","_wasm_generate_async","_wasm_model_info","_wasm_is_ready","_malloc","_free"]' \
3131
-s EXPORTED_RUNTIME_METHODS='["UTF8ToString","allocateUTF8","FS"]' \
3232
-s FORCE_FILESYSTEM=1 \

wasm/quant.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wasm/quant.wasm

-1 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)