Commit 52fbd3b1 authored by Justus Sagemüller's avatar Justus Sagemüller

Choose some default runtime options.

These may be controversial. They are certainly not good for everybody,
but in my opinion better than the GHC default (unlimited memory,
single processor), especially for beginners:

- In Haskell, it's unfortunately somewhat easy to allocate infinite
  amounts of memory. In the default setting, this can grind the entire
  system virtually to a halt by driving everything into swap. This
  is a huge frustration. (Yeah, Matlab likes to do this too, but that
  should be no benchmark...)
  With a memory cap, this will simply crash the program. Especially
  in Jupyter, that's not a big deal since the kernel can easily be
  restarted without losing any work.
- ̶6̶4̶0̶k 3 GiB should be enough for most beginner-relevant
  IHaskell applications, but should fit in most computers' RAM or
  at least reach the limit quickly after entering swap space.
- I see no reason to restrict the runtime to a single processor.
  Almost all machines today have multiple cores, and we're linking
  to the `-threaded` runtime anyway. For some applications it's
  basically necessary to use more than one thread for properly
  responsive operation, including my
  [dynamic-plot](http://hackage.haskell.org/package/dynamic-plot).
- Two processors should be modest enough to not substantially
  slow down any modern system.

Power users can of course always disable the memory cap and choose
more processors, through e.g.

    ihaskell install --use-rtsopts="-N12"
parent 4245ef51
...@@ -55,7 +55,8 @@ data KernelSpecOptions = ...@@ -55,7 +55,8 @@ data KernelSpecOptions =
defaultKernelSpecOptions :: KernelSpecOptions defaultKernelSpecOptions :: KernelSpecOptions
defaultKernelSpecOptions = KernelSpecOptions defaultKernelSpecOptions = KernelSpecOptions
{ kernelSpecGhcLibdir = GHC.Paths.libdir { kernelSpecGhcLibdir = GHC.Paths.libdir
, kernelSpecRTSOptions = [] , kernelSpecRTSOptions = ["-M3g", "-N2"] -- Memory cap 3 GiB,
-- multithreading on two processors.
, kernelSpecDebug = False , kernelSpecDebug = False
, kernelSpecConfFile = defaultConfFile , kernelSpecConfFile = defaultConfFile
, kernelSpecInstallPrefix = Nothing , kernelSpecInstallPrefix = Nothing
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment