I'm using saxonche
python library for XPath3.1 ops in python. I have created a FastAPI that just accepts the XML filename, opens it, processes and returns the response.
It worked fine during development on an Intel MacBook, but in production on an Amazon m7g.2xlarge instance (Debian 12 ARM64), it fails with the following error when processing multiple files.
Fatal error: StackOverflowError: Enabling the yellow zone of the stack did not make any stack space available. Possible reasons for that: 1) A call from native code to Java code provided the wrong JNI environment or the wrong IsolateThread; 2) Frames of native code filled the stack, and now there is not even enough stack space left to throw a regular StackOverflowError; 3) An internal VM error occurred.
XML File size: 5 to 8 MB Production env: m7g.2xlarge(AWS) with Debian 12 ARM64
Questions:
Does saxonche have a limitation with processing multiple files simultaneously?
Could upgrading Java on the server potentially resolve this issue?
Any suggestions for troubleshooting or resolving this error would be greatly appreciated. Thank you for your help!
gunicorn -w 4 -k uvicorn.workers.UvicornWorker main:app
to run the Python app?