ffmpegwasm / ffmpegwasm/ffmpeg.wasm

Initial memory reduction in 0.11 causing OOM from 0.10

未关闭
#451 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C
星标
17.8k
派生
1.1k
PR 合并指标
30 天内没有已合并 PR

描述

**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`?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。