Summary of useful RTS options

The following sections describe flags for controlling the Runtime System's behavior. The exact set of flags available depend on how the Runtime System was configured (via GHC flags).

Scheduler flags

The number of capabilities (OS threads) to use is controlled with N<n>:. This can be changed with setNumCapabilities. (default: 1)

Memory management

These are flags for controlling used heap and stack size:

  • -H<size>: Minimum heap size (default: 0)
  • -M<size>: Maximum heap size (default: unlimited)
  • -ki<size>: Minimum stack size (default: 512k)
  • -K<size>: Maximum stack size (default: 80% system memory)

Garbage collection

These are flags for controlling the generational garbage collector:

  • -G<n>: Number of GC generations (default: 2)
  • -qg<gen> ...

Get Haskell High Performance Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.