New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot initialize worker because of out of memory error on WASM #698
Comments
Please edit your issue to include what version of Tesseract.js you are using. I'm assuming it's the latest version, however it's good to explicitly document and doing so creates a better record for when issues are searched in the future. |
yes, sorry about that i completly forgot, maybe i can build tesseract.js-core with assertions enabled to see whats going on, do you have a pre built files with assertions? |
I tried running Tesseract.js using Chrome on a Samung Galaxy S20 using Browserstack, and it worked correctly. Several follow-up questions are below that may help troubleshoot further.
Regarding building with assertions, I do not have an existing build that does this, and despite the error messages above am skeptical that this would be useful. Presumably the Browser is not allowing Tesseract to allocate the memory it needs. I don't think that building with assertions would help explain why that is. |
Ok i should explain further (sorry about not being more specific before). So i began testing tesseract and saw that my webapp on react didn't behave in mobile as it was on my mac m1. I checked that tesseract.js wasn't initializing and was stuck (didn't get the "progress": 1 from worker).
So to answer your questions:
BTW, Thanks @Balearica for your answers |
The issue you link to on the emscripten page is directly related, as we use emscripten to compile Tesseract to Webassembly. The issue is just that it's a generic error that doesn't help much in explaining why your device is not showing enough memory. A few follow-up questions:
|
Ok, i thought that it wasn't related because the error said something about
I think that tesseract.js-core is using a lot of modules and maybe some of them has a big memory footprint, so when it asks for a big chunk of memory it fails, this shouldn't be an issue with 64 bits because the virtual page address is bigger (quoted from the answer on emscripten before). |
Is it possible for you to post the exact repo you are using along with any instructions for running? As stated above, I previously tried running Tesseract.js with Chrome 32-bit on a Galaxy S20 and it ran as expected. Today I tried running on Chrome 32-bit on a Galaxy S6, which is a much older device (released Spring 2015), and that also ran as expected. Therefore, I would need access to your site/repo to do anything further, as I am unable to reproduce the issue without it. |
Also, regarding "app creates only one webworker i think", I would confirm this by adding a |
yes, i can try to reproduce the same error on a new repo, but give me a few days. The function that makes the worker happens one time so it's creating one web worker. Thanks for your answers |
Is there any follow-up here? If not I will close as stale. |
sorry couldn't have the time to create a working demo that reproduces the error, when i have time i will make a new issue. thanks @Balearica |
Hi, im currently facing an issue on mobile phone using chrome 32 bits (with 64 bits works fine):
Google Chrome: 108.0.5359.79 (Official Build) (32-bit)
Revision: 5194e1e1073e30a8fc93c72c2aee4bc572f5b07a-refs/branch-heads/5359_61
OS: Android 12; SM-G780F Build/SP1A.210812.016
JavaScript: V8 10.8.168.21
Library Tesseract.js installed using npm (
"tesseract.js": "^4.0.0"
)When using tesseract.js from react app sometimes hangs up on initialization, changing line 40 in
src/worker-script/index.js
with:will reveal that there is a problem with memory its rejecting with message:
The text was updated successfully, but these errors were encountered: