You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attaching a new thread through jpype.attachThreadToJVM after the JVM has started works perfectly for each API call. However, after a few days of running the instance, it failed to attach a new thread to the JVM and returned the following error.
File "/src/api/views.py", line 130, in convert
core.initialise_jpype()
File "/src/app/core.py", line 34, in initialise_jpype
jpype.attachThreadToJVM()
File "/usr/local/lib/python3.10/site-packages/jpype/_core.py", line 76, in func2
return func2._real(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/jpype/_core.py", line 388, in attachThreadToJVM
_jpype.attachThreadToJVM()
RuntimeError: Unable to attach to thread
Even in jpype.isJVMStarted() gives true.
The text was updated successfully, but these errors were encountered:
It sounds like ot ran out of handles. JPype automatically attaches to threads so there is no reason to explicitely call attach. It isn't harmful, but hasn't been necessary for years. There is however a reason to detach. If you are making lots of threads, you must detach them at the end of life or eventually you will exhaust the handle pool.
I am fairly sure this appears in the JPype documentation.
Attaching a new thread through
jpype.attachThreadToJVM
after the JVM has started works perfectly for each API call. However, after a few days of running the instance, it failed to attach a new thread to the JVM and returned the following error.Even in
jpype.isJVMStarted()
gives true.The text was updated successfully, but these errors were encountered: