ffmpegwasm / ffmpegwasm/ffmpeg.wasm
Initial memory reduction in 0.11 causing OOM from 0.10
- Dominant language
- C
- Stars
- 17.8k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Upgraded from 0.10 to 0.11 and started seeing OOM issues.
To fix the issue, I applied the following patch to the wasm-core repo and rebuilt it:
```diff
diff --git a/wasm/build-scripts/build-ffmpeg.sh b/wasm/build-scripts/build-ffmpeg.sh
index f533292816..c34ad55528 100755
--- a/wasm/build-scripts/build-ffmpeg.sh
+++ b/wasm/build-scripts/build-ffmpeg.sh
@@ -11,7 +11,7 @@ if [[ "$FFMPEG_ST" != "yes" ]]; then
-s USE_PTHREADS=1 # enable pthreads support
-s PROXY_TO_PTHREAD=1 # detach main() from browser/UI main thread
-o wasm/packages/core/dist/ffmpeg-core.js
- -s INITIAL_MEMORY=1073741824 # 1GB
+ -s INITIAL_MEMORY=2146435072 # 2GB
)
else
mkdir -p wasm/packages/core-st/dist
```
Looks like the initial memory was changed from 2GB to 1GB in the upgrade to 0.11 (https://github.com/ffmpegwasm/ffmpeg.wasm-core/commit/3ea42134df885c35a011715225d3996dc35abdeb & https://github.com/ffmpegwasm/ffmpeg.wasm-core/commit/19f90cf797e70b87f02d967577989d1548cbbf21)
Is restoring the initial memory to 2GB a good solution?
Or should it keep with 1GB and then use `ALLOW_MEMORY_GROWTH=1`?
Contributor guide
Assessment
This issue has not been assessed yet.