How long pauses can occur in a Haskell program due to garbage collection?

前端 未结 1 696
伪装坚强ぢ
伪装坚强ぢ 2021-02-02 12:57

Relating to my other question Haskell collections with guaranteed worst-case bounds for every single operation?, I\'m curious: How long pauses can be caused by garbage c

1条回答
  •  遥遥无期
    2021-02-02 13:37

    GHC is designed for computational throughput, not latency. As a result, GHC uses a generational, multi-threaded garbage collector with thread-local heaps. Garbage collection of thread-local objects does not stop other threads. The occasional major GC of the global heap will pause all threads.

    Typically the pauses are in the small number of milliseconds, hwoever there is no guarantee of latency.

    You can control the frequency of GC via several runtime flags (e.g. the gc -I interval).

    0 讨论(0)
提交回复
热议问题