tweag/inline-java

Bound the queue of the finalizer thread

facundominguez opened this issue · 0 comments

Currently the queue of the finalizer thread is unbounded, which can lead to memory exhaustion if the worker thread cannot keep up with the submission rate.

Ideally, the queue would be bounded to some configurable value, and the submiters would be blocked when the queue is full.

Perhaps the value can be configured with a new call setFinalizerThreadQueueSize :: Int -> IO (), and we would have some "large" default value.