robertknight / tesseract-wasm

JS/WebAssembly build of the Tesseract OCR engine for use in browsers and Node
https://robertknight.github.io/tesseract-wasm/
BSD 2-Clause "Simplified" License
264 stars 27 forks source link

Increase max heap size to 1GB #73

Closed robertknight closed 1 year ago

robertknight commented 1 year ago

Very large input images (see #31) can cause the current 128MB limit to be reached.

According to https://github.com/emscripten-core/emscripten/blob/d51b376a7f53ca61ca86a9d2ce4578b629ee625c/src/settings.js#L161 the initial memory defaults to 16MB, and the ALLOW_MEMORY_GROWTH setting allows it to grow up to this cap.

Fixes #31