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
The OpenCV C++ library uses Thread Local State (TLS). Unfortunately the TLS data is not freed when the OS thread terminates. See opencv/opencv#9745.
This is especially troublesome in Haskell where the runtime system by default executes FFI calls on random available OS threads. The user has no control over the lifetime of these OS threads which means there's a high risk of leaking OpenCV TLS data.
Until we find a solution in haskell-opencv we advise to do all OpenCV work on a bound Haskell thread (see forkOS or asyncBound) which ensures all FFI calls from that Haskell thread are done on the same OS thread. Then terminate these threads as little as possible.
Ping @ocharles, you might be suffering from this in production.
The text was updated successfully, but these errors were encountered:
The OpenCV C++ library uses Thread Local State (TLS). Unfortunately the TLS data is not freed when the OS thread terminates. See opencv/opencv#9745.
This is especially troublesome in Haskell where the runtime system by default executes FFI calls on random available OS threads. The user has no control over the lifetime of these OS threads which means there's a high risk of leaking OpenCV TLS data.
Until we find a solution in
haskell-opencv
we advise to do all OpenCV work on a bound Haskell thread (see forkOS or asyncBound) which ensures all FFI calls from that Haskell thread are done on the same OS thread. Then terminate these threads as little as possible.Ping @ocharles, you might be suffering from this in production.
The text was updated successfully, but these errors were encountered: