ffmpegwasm / ffmpegwasm/ffmpeg.wasm
ERR_OUT_OF_MEMORY, when using "createFFmpeg" several times
- Lingua principale
- C
- Stelle
- 17.8k
- Fork
- 1.1k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
**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.
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.