17

In the Shake documentation it recommends compiling using the flag -with-rtsopts=-I0 to disable idle garbage collection. Why does Shake recommend that?

asked Jan 4, 2016 at 9:29

1 Answer 1

20

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.

answered Jan 4, 2016 at 9:29
Sign up to request clarification or add additional context in comments.

1 Comment

More generally, idle garbage collection is primarily for interactive applications, and also for concurrent situations where the application in question is likely to delay many other threads in a major collection.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.