How can I disable GCs, or vastly decrease the frequency of GCs?
Like giving it an +RTS
option for some huge heap or or allocation size maybe?
I want to see how my program behaves when no GCs happen.
I had good results combining nh2 and Thomas's answers into
+RTS -I0 -A90G -G1 -m1 -RTS
I have 100 GB of RAM, so I thought 90G
was a good allocation area size.
I also used System.Mem.performGC
to manually trigger GC at appropriate points and GHC.Stats
to keep track of how much time has been spent in GC.
(With the help from carter in #ghc on freenode)
There is no switch to completely disable GC. Instead, use all of the following +RTS
runtime options:
-I0
.-A100G
, as GC will only be done when the allocation area is full.See https://downloads.haskell.org/~ghc/7.8-latest/docs/html/users_guide/runtime-control.html for a description of these options.
Be aware that you will run out of RAM quickly.
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