-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels