sz3 / libcimbar

Optimized implementation for color-icon-matrix barcodes
https://cimbar.org
Mozilla Public License 2.0
4.24k stars 307 forks source link

Aborted(OOM) error #96

Open Katzenwerfer opened 6 months ago

Katzenwerfer commented 6 months ago

Trying to load a ~90 MB file and I'm getting this error. More specifically these 2.

17:13:38.013 file input: [object HTMLInputElement] main.js:126:13
17:13:39.065 Aborted(OOM) cimbar_js.js:1:5472
    abort https://cimbar.org/cimbar_js.js:1
    abortOnCannotGrowMemory https://cimbar.org/cimbar_js.js:1
    _emscripten_resize_heap https://cimbar.org/cimbar_js.js:1
    <anonymous> https://cimbar.org/cimbar_js.wasm:64936
    <anonymous> https://cimbar.org/cimbar_js.wasm:12358
    onload https://cimbar.org/main.js:25
    (Async: EventHandlerNonNull)
    importFile https://cimbar.org/main.js:22
    fileInput https://cimbar.org/main.js:129
    onchange https://cimbar.org/:1
17:13:39.067 Uncaught RuntimeError: Aborted(OOM). Build with -sASSERTIONS for more info. cimbar_js.js:1:5558
    abort https://cimbar.org/cimbar_js.js:1
    abortOnCannotGrowMemory https://cimbar.org/cimbar_js.js:1
    _emscripten_resize_heap https://cimbar.org/cimbar_js.js:1
    onload https://cimbar.org/main.js:25
    importFile https://cimbar.org/main.js:22
    fileInput https://cimbar.org/main.js:129
    onchange https://cimbar.org/:1
sz3 commented 6 months ago

Neat!

cimbar currently can't support files larger than 33MB post-compression (specifically, the number is 33554431 bytes, 2^25-1), so unless your 90MB file compresses very well it's probably too large even if we don't hit the OOM error. But it'd be nice to not run out of memory. :thinking: