ghci balkiness on OS X?

Evan Laforge qdunkan at gmail.com
Sat Oct 25 00:44:40 UTC 2014


On Fri, Oct 24, 2014 at 7:23 AM, Thomas Hallgren <hallgren at chalmers.se> wrote:
> Foruntately, the idle time GC can be turned off by running ghci +RTS -I0, and
> when I do that the problem goes away. Alternatively, using a longer timeout
> (e.g. -I2) is enough to prevent the major GCs from happening while you are
> typing, so it also helps a lot.

Aha, +RTS -I0 does the trick!  I'll bet it messes up haskeline because
the sudden delays cause it to time out between keystrokes.  But with
that flag, it stays responsive no matter how many modules I have
loaded.  Thanks.

I wonder why I can only get this to happen on OS X?  Maybe the linux
machine just has faster memory and can get through the GC quicker?
Anyway, I wonder if disabling idle GC would make sense for ghci in
general?  ghci, unlike a normal program, is unlikely to be doing
background work while its waiting on the prompt, so there is no new
garbage for the GC to detect.  Also, input latency is very noticeable,
though I suppose that goes for all interactive programs.  In fact I'm
tempted to try this on my interactive program.

On Thu, Oct 23, 2014 at 10:37 PM, Judah Jacobson
<judah.jacobson at gmail.com> wrote:
> and hold down the 'a' key, does it smoothly output "{a}{a}{a}..." or does it
> have similar hiccups?

I get hiccups, though they're usually after I pause for a bit.  This
is consistent with the "idle GC" theory, so I think that was probably
the problem.


More information about the Glasgow-haskell-users mailing list