webm.js icon indicating copy to clipboard operation
webm.js copied to clipboard

Minimize memory consumption

Open Kagami opened this issue 9 years ago • 4 comments

Things currently broken:

  • [x] Subtitles rendering, process hungs
  • [x] Encoding the entire file, audio/last video processes hungs

Things still causing out of memory:

  • [x] ~400M fails at info stage
  • [x] ~200M fails while encoding

What can be done?

  • Small -max_alloc helps at info stage
  • -blocksize ?
  • Some advanced ffmpeg options/try to patch?
  • Compile with ALLOW_MEMORY_GROWTH, bench results?

Kagami avatar Aug 17 '15 09:08 Kagami

TOTAL_MEMORY=256M for encoder and 128M for prober allows to successfully encode 600M+ files. MEMFS works with that values too but consumes much more memory.

ALLOW_MEMORY_GROWTH works as well and doesn't cause significant slowdown in nightly, though it may cause problems in v8 so let's keep it disabled for now.

It still may be worth to try advanced ffmpeg options and bigger files/different TOTAL_MEMORY values in order to decrease memory consumption even more.

Kagami avatar Aug 17 '15 14:08 Kagami

Any updates on this?

uqee avatar Sep 27 '17 14:09 uqee

Switching build to WebAssembly should allow natural memory growth without the performance penalty from asm.js's growth mode...

bvibber avatar Sep 27 '17 15:09 bvibber

Thanks, @brion, worth a try.

uqee avatar Sep 27 '17 15:09 uqee