ffmpegwasm / ffmpegwasm/ffmpeg.wasm
ERR_OUT_OF_MEMORY, when using "createFFmpeg" several times
- Dominant language
- C
- Stars
- 17.8k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
**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.

**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.
Contributor guide
Assessment
This issue has not been assessed yet.