ffmpegwasm / ffmpegwasm/ffmpeg.wasm

ERR_OUT_OF_MEMORY, when using "createFFmpeg" several times

未關閉
#200 6 則留言 7 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
C
星號
17.8k
分支
1.1k
PR 合併指標
30 天內沒有已合併 PR

描述

**Describe the bug**
To see the memory usages and limitation of "ffmpeg.wasm", I tested it with a simple example.
I created "createFFmpeg" several times. The memory in the browser increased linearly. However it did not get backed to the original memory size, even though it was defined locally. And eventually, generated "ERR_OUT_OF_MEMORY" in the browser.

**To Reproduce**
1. Used the below code

const init_ffmpeg = async () => {
let ffmpeg = await createFFmpeg()
try {
await ffmpeg.load()
} catch (e) {
console.log(e)
}

ffmpeg = null
// ffmpeg.exit()
}

2. The above code called around 20 times
3. Then the error

**Expected behavior**
I thought "ffmpeg = null" or "ffmpeg.exit()" will be used for garbage collection in the browser.
I'd like to remove the "ffmpeg" perfectly, and recreate it again and again for other processes.

**Screenshots**
My memory started from around 500M. When reaching around 2GB (By calling the above code), it made the error.

![image](https://user-images.githubusercontent.com/17169166/119245969-839d5680-bb4b-11eb-84f1-94a34c800d9f.png)

**Desktop (please complete the following information):**
- OS: window
- Browser: chrome
- Version: 90
- @ffmpeg/ffmpeg version: 0.10.0

**Additional context**
Thank you very much for great library!
And hope to hear a good solution.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。