In the Shake documentation it recommends compiling using the flag -with-rtsopts=-I0
to disable idle garbage collection. Why does Shake recommend that?
By default (without the flag) GHC performs a garbage collection (GC) if all Haskell threads have been idle for 0.3 seconds. Since a build system is regularly running external processes, it is quite common for all Haskell threads to be idle for > 0.3s, which causes a lot of unnecessary garbage collections. Since the machine is likely to be fully loaded from the processes Shake is running, the GC will take time away that could otherwise be doing useful work. The problem is exacerbated if the GC runs multi-threaded.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With